]> Git Repo - secp256k1.git/log
secp256k1.git
8 years agoMerge #407: Modify parameter order of internal functions to match API parameter order
Pieter Wuille [Wed, 26 Oct 2016 22:04:38 +0000 (15:04 -0700)]
Merge #407: Modify parameter order of internal functions to match API parameter order

353c1bf Fix secp256k1_ge_set_table_gej_var parameter order (llamasoft)
541b783 Fix secp256k1_ge_set_all_gej_var parameter order (llamasoft)
7d893f4 Fix secp256k1_fe_inv_all_var parameter order (llamasoft)

8 years agoMerge #411: Remove guarantees about memcmp-ability
Pieter Wuille [Wed, 26 Oct 2016 21:54:09 +0000 (14:54 -0700)]
Merge #411: Remove guarantees about memcmp-ability

91219a1 Remove guarantees about memcmp-ability (Andrew Poelstra)

8 years agoMerge #421: Update scalar_4x64_impl.h
Pieter Wuille [Wed, 26 Oct 2016 21:24:52 +0000 (14:24 -0700)]
Merge #421: Update scalar_4x64_impl.h

9d67afa Update scalar_4x64_impl.h (Alex-GR)

8 years agoMerge #422: Restructure nonce clearing
Pieter Wuille [Wed, 26 Oct 2016 21:14:13 +0000 (14:14 -0700)]
Merge #422: Restructure nonce clearing

3769783 Restructure nonce clearing (bgorlick)
0f9e69d Restructure nonce clearing (bgorlick)

8 years agoRestructure nonce clearing
bgorlick [Fri, 21 Oct 2016 11:59:32 +0000 (04:59 -0700)]
Restructure nonce clearing

Make sure we clear the nonce data even if the nonce function fails (it may have written partial data), and call memset only once in the case we iterate to produce a valid signature.

8 years agoRestructure nonce clearing
bgorlick [Fri, 21 Oct 2016 10:50:10 +0000 (03:50 -0700)]
Restructure nonce clearing

Make sure we clear the nonce data even if the nonce function fails (it may have written partial data), and call memset only once in the case we iterate to produce a valid signature.

8 years agoUpdate scalar_4x64_impl.h
Alex-GR [Sat, 8 Oct 2016 21:16:50 +0000 (00:16 +0300)]
Update scalar_4x64_impl.h

XOR reg,reg instead of MOV 0 to reg. It should be at least equal in all architectures and faster in some else.

8 years agoMerge #413: fix auto-enabled static precompuatation
Pieter Wuille [Mon, 12 Sep 2016 16:04:44 +0000 (18:04 +0200)]
Merge #413: fix auto-enabled static precompuatation

00c5d2e fix auto-enabled static precompuatation (Cory Fields)

8 years agofix auto-enabled static precompuatation
Cory Fields [Wed, 7 Sep 2016 16:14:18 +0000 (12:14 -0400)]
fix auto-enabled static precompuatation

This was broken in aa0b1fd14979145d54ef85485cb497a9cdbc22c7

8 years agoRemove guarantees about memcmp-ability
Andrew Poelstra [Fri, 26 Aug 2016 18:03:48 +0000 (18:03 +0000)]
Remove guarantees about memcmp-ability

8 years agoMerge #410: Add string.h include to ecmult_impl
Pieter Wuille [Thu, 4 Aug 2016 18:38:26 +0000 (20:38 +0200)]
Merge #410: Add string.h include to ecmult_impl

0bbd5d4 Add string.h include to ecmult_impl (Wladimir J. van der Laan)

8 years agoAdd string.h include to ecmult_impl
Wladimir J. van der Laan [Thu, 4 Aug 2016 10:58:29 +0000 (12:58 +0200)]
Add string.h include to ecmult_impl

`memcpy` and `memset` are used, so include the appropriate header
for the declaration.

8 years agoFix secp256k1_ge_set_table_gej_var parameter order
llamasoft [Tue, 26 Jul 2016 16:53:29 +0000 (11:53 -0500)]
Fix secp256k1_ge_set_table_gej_var parameter order

Rearranged secp256k1_ge_set_table_gej_var parameters so length comes last (it modifies both *a and *zr).

8 years agoFix secp256k1_ge_set_all_gej_var parameter order
llamasoft [Tue, 26 Jul 2016 16:48:28 +0000 (11:48 -0500)]
Fix secp256k1_ge_set_all_gej_var parameter order

Rearranged secp256k1_ge_set_all_gej_var parameters so length comes after *a.

8 years agoFix secp256k1_fe_inv_all_var parameter order
llamasoft [Tue, 26 Jul 2016 15:57:08 +0000 (10:57 -0500)]
Fix secp256k1_fe_inv_all_var parameter order

Rearranged secp256k1_fe_inv_all_var parameters so length is after array.
Text editor removed some trailing whitespaces.

8 years agoMerge #405: Make secp256k1_fe_sqrt constant time
Pieter Wuille [Sat, 9 Jul 2016 17:39:49 +0000 (19:39 +0200)]
Merge #405: Make secp256k1_fe_sqrt constant time

926836a Make secp256k1_fe_sqrt constant time (Pieter Wuille)

8 years agoMake secp256k1_fe_sqrt constant time
Pieter Wuille [Sat, 9 Jul 2016 12:23:44 +0000 (14:23 +0200)]
Make secp256k1_fe_sqrt constant time

8 years agoMerge #404: Replace 3M + 4S doubling formula with 2M + 5S one
Pieter Wuille [Thu, 7 Jul 2016 15:06:42 +0000 (17:06 +0200)]
Merge #404: Replace 3M + 4S doubling formula with 2M + 5S one

8ec49d8 Add note about 2M + 5S doubling formula (Andrew Poelstra)

8 years agoAdd note about 2M + 5S doubling formula
Andrew Poelstra [Thu, 30 Jul 2015 17:30:15 +0000 (12:30 -0500)]
Add note about 2M + 5S doubling formula

8 years agoMerge #400: A couple minor cleanups
Pieter Wuille [Wed, 6 Jul 2016 12:12:10 +0000 (14:12 +0200)]
Merge #400: A couple minor cleanups

ac01378 build: add -DSECP256K1_BUILD to benchmark_internal build flags (Andrew Poelstra)
a6c6f99 Remove a bunch of unused stdlib #includes (Andrew Poelstra)

8 years agobuild: add -DSECP256K1_BUILD to benchmark_internal build flags
Andrew Poelstra [Mon, 6 Jun 2016 18:32:29 +0000 (18:32 +0000)]
build: add -DSECP256K1_BUILD to benchmark_internal build flags

gcc 6 will warn about our non-null checks when SECP256K1_BUILD
our NONNULL marker is nontrivial. This occurs unless SECP256K1_BUILD
is set, which we had forgotten to do for the internal benchmarks,
which compile directly against the library instead of linking.

8 years agoRemove a bunch of unused stdlib #includes
Andrew Poelstra [Sun, 5 Jun 2016 21:39:17 +0000 (21:39 +0000)]
Remove a bunch of unused stdlib #includes

8 years agoMerge #403: configure: add flag to disable OpenSSL tests
Pieter Wuille [Wed, 6 Jul 2016 10:07:58 +0000 (12:07 +0200)]
Merge #403: configure: add flag to disable OpenSSL tests

a9b2a5d configure: add flag to disable OpenSSL tests (Andrew Poelstra)

8 years agoconfigure: add flag to disable OpenSSL tests
Andrew Poelstra [Tue, 5 Jul 2016 11:00:39 +0000 (11:00 +0000)]
configure: add flag to disable OpenSSL tests

OpenSSL messes up valgrind.

8 years agoMerge #402: Add support for testing quadratic residues
Pieter Wuille [Mon, 4 Jul 2016 11:59:10 +0000 (13:59 +0200)]
Merge #402: Add support for testing quadratic residues

e6e9805 Add function for testing quadratic residue field/group elements. (Pieter Wuille)
efd953a Add Jacobi symbol test via GMP (Peter Dettman)

8 years agoAdd function for testing quadratic residue field/group elements.
Pieter Wuille [Wed, 25 Nov 2015 16:38:44 +0000 (17:38 +0100)]
Add function for testing quadratic residue field/group elements.

8 years agoAdd Jacobi symbol test via GMP
Peter Dettman [Fri, 3 Jul 2015 12:21:52 +0000 (21:51 +0930)]
Add Jacobi symbol test via GMP

Also add native Jacobi symbol test (Andrew)

Rebased-by: Andrew Poelstra
Rebased-by: Pieter Wuille
8 years agoMerge #401: ecmult_const: unify endomorphism and non-endomorphism skew cases
Pieter Wuille [Thu, 30 Jun 2016 13:50:33 +0000 (15:50 +0200)]
Merge #401: ecmult_const: unify endomorphism and non-endomorphism skew cases

c6191fd ecmult_const: unify endomorphism and non-endomorphism skew cases (Andrew Poelstra)

8 years agoecmult_const: unify endomorphism and non-endomorphism skew cases
Andrew Poelstra [Thu, 30 Jun 2016 09:59:10 +0000 (09:59 +0000)]
ecmult_const: unify endomorphism and non-endomorphism skew cases

We now do a skew correction even without the endomorphism optimization,
which costs one additional group addition but unifies a lot of code.

8 years agoMerge #378: .gitignore build-aux cleanup
Pieter Wuille [Wed, 29 Jun 2016 09:19:13 +0000 (11:19 +0200)]
Merge #378: .gitignore build-aux cleanup

70141a8 Update .gitignore (upgradeadvice)

8 years agoMerge #384: JNI: align shared files copyright/comments to bitcoinj's
Pieter Wuille [Wed, 29 Jun 2016 09:16:49 +0000 (11:16 +0200)]
Merge #384: JNI: align shared files copyright/comments to bitcoinj's

6ceea2c align shared files copyright/comments to bitcoinj's (GreenAddress)

8 years agoMerge #399: build: verify that the native compiler works for static precomp
Pieter Wuille [Wed, 29 Jun 2016 09:10:13 +0000 (11:10 +0200)]
Merge #399: build: verify that the native compiler works for static precomp

aa0b1fd build: verify that the native compiler works for static precomp (Cory Fields)

8 years agoMerge #398: Test whether ECDH and Schnorr are enabled for JNI
Pieter Wuille [Mon, 30 May 2016 17:58:18 +0000 (19:58 +0200)]
Merge #398: Test whether ECDH and Schnorr are enabled for JNI

eee808d Test whether ECDH and Schnorr are enabled for JNI (Pieter Wuille)

8 years agobuild: verify that the native compiler works for static precomp
Cory Fields [Tue, 16 Feb 2016 20:50:17 +0000 (15:50 -0500)]
build: verify that the native compiler works for static precomp

8 years agoTest whether ECDH and Schnorr are enabled for JNI
Pieter Wuille [Wed, 25 May 2016 17:15:42 +0000 (19:15 +0200)]
Test whether ECDH and Schnorr are enabled for JNI

8 years agoMerge #366: ARM assembly implementation of field_10x26 inner (rebase of #173)
Pieter Wuille [Wed, 25 May 2016 17:01:24 +0000 (19:01 +0200)]
Merge #366: ARM assembly implementation of field_10x26 inner (rebase of #173)

001f176 ARM assembly implementation of field_10x26 inner (Wladimir J. van der Laan)

8 years agoARM assembly implementation of field_10x26 inner
Wladimir J. van der Laan [Wed, 24 Dec 2014 11:12:37 +0000 (12:12 +0100)]
ARM assembly implementation of field_10x26 inner

Rebased-by: Pieter Wuille <[email protected]>
8 years agoMerge #397: Small fixes for sha256
Pieter Wuille [Wed, 25 May 2016 16:23:07 +0000 (18:23 +0200)]
Merge #397: Small fixes for sha256

3f8b78e Fix undefs in hash_impl.h (Kirill Fomichev)
2ab4695 Fix state size in sha256 struct (Kirill Fomichev)

8 years agoFix undefs in hash_impl.h
Kirill Fomichev [Sat, 21 May 2016 07:18:57 +0000 (10:18 +0300)]
Fix undefs in hash_impl.h

8 years agoFix state size in sha256 struct
Kirill Fomichev [Sat, 21 May 2016 07:17:06 +0000 (10:17 +0300)]
Fix state size in sha256 struct

8 years agoMerge #386: Add some missing `VERIFY_CHECK(ctx != NULL)`
Pieter Wuille [Sun, 8 May 2016 18:01:19 +0000 (20:01 +0200)]
Merge #386: Add some missing `VERIFY_CHECK(ctx != NULL)`

bcc4881 Add some missing `VERIFY_CHECK(ctx != NULL)` for functions that use `ARG_CHECK` (Andrew Poelstra)

8 years agoMerge #389: Cast pointers through uintptr_t under JNI
Pieter Wuille [Sun, 8 May 2016 17:57:43 +0000 (19:57 +0200)]
Merge #389: Cast pointers through uintptr_t under JNI

47b9e78 Cast pointers through uintptr_t under JNI (Jon Griffiths)

8 years agoMerge #390: Update bitcoin-core GitHub links
Pieter Wuille [Sun, 8 May 2016 17:56:26 +0000 (19:56 +0200)]
Merge #390: Update bitcoin-core GitHub links

faa2a11 Update bitcoin-core GitHub links (MarcoFalke)

8 years agoMerge #391: JNI: Only call ecdsa_verify if its inputs parsed correctly
Pieter Wuille [Sun, 8 May 2016 17:53:56 +0000 (19:53 +0200)]
Merge #391: JNI: Only call ecdsa_verify if its inputs parsed correctly

a40c701 JNI: Only call ecdsa_verify if its inputs parsed correctly (Jon Griffiths)

8 years agoMerge #392: Add testcase which hits additional branch in secp256k1_scalar_sqr
Pieter Wuille [Sun, 8 May 2016 17:52:28 +0000 (19:52 +0200)]
Merge #392: Add testcase which hits additional branch in secp256k1_scalar_sqr

093a497 Add testcase which hits additional branch in secp256k1_scalar_sqr (Jonas Nick)

8 years agoMerge #388: bench_ecdh: fix call to secp256k1_context_create
Pieter Wuille [Sun, 8 May 2016 17:49:05 +0000 (19:49 +0200)]
Merge #388: bench_ecdh: fix call to secp256k1_context_create

f36f9c6 bench_ecdh: fix call to secp256k1_context_create (Andrew Poelstra)

8 years agoAdd testcase which hits additional branch in secp256k1_scalar_sqr
Jonas Nick [Tue, 3 May 2016 03:19:00 +0000 (20:19 -0700)]
Add testcase which hits additional branch in secp256k1_scalar_sqr

8 years agoJNI: Only call ecdsa_verify if its inputs parsed correctly
Jon Griffiths [Mon, 2 May 2016 11:21:33 +0000 (23:21 +1200)]
JNI: Only call ecdsa_verify if its inputs parsed correctly

Return 0 otherwise instead of calling it with bad parameters.

8 years agoUpdate bitcoin-core GitHub links
MarcoFalke [Fri, 29 Apr 2016 21:25:27 +0000 (23:25 +0200)]
Update bitcoin-core GitHub links

8 years agoCast pointers through uintptr_t under JNI
Jon Griffiths [Thu, 28 Apr 2016 08:25:31 +0000 (20:25 +1200)]
Cast pointers through uintptr_t under JNI

Fixes warnings of the form "warning: cast to pointer from integer of
different size" when building on 32 bit platforms. This is the same
approach used for pointer conversions in the openjdk sources.

8 years agobench_ecdh: fix call to secp256k1_context_create
Andrew Poelstra [Wed, 27 Apr 2016 10:16:18 +0000 (10:16 +0000)]
bench_ecdh: fix call to secp256k1_context_create

8 years agoAdd some missing `VERIFY_CHECK(ctx != NULL)` for functions that use `ARG_CHECK`
Andrew Poelstra [Tue, 26 Apr 2016 15:49:02 +0000 (15:49 +0000)]
Add some missing `VERIFY_CHECK(ctx != NULL)` for functions that use `ARG_CHECK`

The `ARG_CHECK` macro requires that a variable called `ctx` exist and be
non-NULL. However, in several functions that do not use the context variable,
we simply ignore it with `(void)ctx`. Replace these with explicit checks for
non-NULLness to avoid invalid memory accesses.

8 years agoalign shared files copyright/comments to bitcoinj's
GreenAddress [Sun, 27 Mar 2016 14:21:34 +0000 (16:21 +0200)]
align shared files copyright/comments to bitcoinj's

8 years agoUpdate .gitignore
upgradeadvice [Tue, 16 Feb 2016 22:59:00 +0000 (16:59 -0600)]
Update .gitignore

Don't ignore everything under build-aux

8 years agoMerge #373: build: fix x86_64 asm detection for some compilers
Pieter Wuille [Tue, 16 Feb 2016 19:44:26 +0000 (20:44 +0100)]
Merge #373: build: fix x86_64 asm detection for some compilers

3f8fdfb build: fix x86_64 asm detection for some compilers (Cory Fields)

8 years agoMerge #374: Add note about y=0 being possible on one of the sextic twists
Pieter Wuille [Tue, 16 Feb 2016 19:42:23 +0000 (20:42 +0100)]
Merge #374: Add note about y=0 being possible on one of the sextic twists

e72e93a Add note about y=0 being possible on one of the sextic twists (Andrew Poelstra)

8 years agoMerge #364: JNI rebased
Pieter Wuille [Tue, 16 Feb 2016 19:33:30 +0000 (20:33 +0100)]
Merge #364: JNI rebased

86e2d07 JNI library: cleanup, removed unimplemented code (GreenAddress)
3093576 JNI library (GreenAddress)

8 years agoJNI library: cleanup, removed unimplemented code
GreenAddress [Mon, 1 Feb 2016 12:37:33 +0000 (13:37 +0100)]
JNI library: cleanup, removed unimplemented code

8 years agoJNI library
GreenAddress [Wed, 17 Dec 2014 03:23:17 +0000 (22:23 -0500)]
JNI library

Squashed and rebased. Thanks to @theuni and @faizkhan00 for doing
the majority of work here! Also thanks to @btchip for help with debugging
and review.

8 years agoMerge pull request #371
Pieter Wuille [Wed, 27 Jan 2016 19:58:52 +0000 (20:58 +0100)]
Merge pull request #371

e5a9047 [Trivial] Remove double semicolons (paveljanik)

9 years agoAdd note about y=0 being possible on one of the sextic twists
Andrew Poelstra [Sun, 10 Jan 2016 08:35:59 +0000 (08:35 +0000)]
Add note about y=0 being possible on one of the sextic twists

9 years agobuild: fix x86_64 asm detection for some compilers
Cory Fields [Mon, 4 Jan 2016 16:36:46 +0000 (11:36 -0500)]
build: fix x86_64 asm detection for some compilers

I Noticed this on OSX with clang, though it likely happens elsewhere as well.
The result is disabled x86_64 asm.

Due to missing escaping, this $0 was interpreted as the function name
SECP_64BIT_ASM_CHECK, causing the compile-check to be broken on some compilers.

The actual check looked like this:

int main()
{
  uint64_t a = 11, tmp;
  __asm__ __volatile__("movq SECP_64BIT_ASM_CHECKx100000000,%1; mulq %%rsi" : "+a"(a) : "S"(tmp) : "cc", "%rdx");
  return 0;
}

It seems even more odd that it compiled anywhere.

9 years ago[Trivial] Remove double semicolons
paveljanik [Wed, 30 Dec 2015 07:42:42 +0000 (08:42 +0100)]
[Trivial] Remove double semicolons

9 years agoMerge pull request #360
Pieter Wuille [Sat, 12 Dec 2015 20:42:03 +0000 (21:42 +0100)]
Merge pull request #360

83221ec Add experimental features to configure (Pieter Wuille)

9 years agoMerge pull request #302
Pieter Wuille [Tue, 1 Dec 2015 20:02:17 +0000 (21:02 +0100)]
Merge pull request #302

03d4611 Add sage verification script for the group laws (Pieter Wuille)

9 years agoAdd sage verification script for the group laws
Pieter Wuille [Mon, 31 Aug 2015 03:08:47 +0000 (05:08 +0200)]
Add sage verification script for the group laws

9 years agoMerge pull request #361
Pieter Wuille [Thu, 26 Nov 2015 23:54:29 +0000 (00:54 +0100)]
Merge pull request #361

5d4c5a3 Prevent damage_array in the signature test from going out of bounds. (Gregory Maxwell)

9 years agoAdd experimental features to configure
Pieter Wuille [Wed, 25 Nov 2015 23:06:41 +0000 (00:06 +0100)]
Add experimental features to configure

9 years agoPrevent damage_array in the signature test from going out of bounds.
Gregory Maxwell [Thu, 26 Nov 2015 20:57:35 +0000 (20:57 +0000)]
Prevent damage_array in the signature test from going out of bounds.

9 years agoMerge pull request #356
Pieter Wuille [Tue, 24 Nov 2015 20:52:49 +0000 (21:52 +0100)]
Merge pull request #356

03d84a4 Benchmark against OpenSSL verification (Pieter Wuille)

9 years agoMerge pull request #357
Pieter Wuille [Tue, 17 Nov 2015 00:47:25 +0000 (01:47 +0100)]
Merge pull request #357

445f7f1 Fix for Windows compile issue (ptschip)

9 years agoFix for Windows compile issue
ptschip [Tue, 17 Nov 2015 00:40:12 +0000 (16:40 -0800)]
Fix for Windows compile issue

Change CPPFLAGS_FOR_BUILD path  (by paveljanik)

9 years agoBenchmark against OpenSSL verification
Pieter Wuille [Sun, 15 Nov 2015 14:46:17 +0000 (15:46 +0100)]
Benchmark against OpenSSL verification

9 years agoMerge pull request #351
Pieter Wuille [Thu, 5 Nov 2015 19:48:48 +0000 (20:48 +0100)]
Merge pull request #351

06aeea5 Turn secp256k1_ec_pubkey_serialize outlen to in/out (Pieter Wuille)

9 years agoTurn secp256k1_ec_pubkey_serialize outlen to in/out
Pieter Wuille [Thu, 5 Nov 2015 05:01:56 +0000 (06:01 +0100)]
Turn secp256k1_ec_pubkey_serialize outlen to in/out

9 years agoMerge pull request #348
Pieter Wuille [Thu, 5 Nov 2015 00:30:00 +0000 (01:30 +0100)]
Merge pull request #348

6466625 Improvements for coordinate decompression (Pieter Wuille)

9 years agoImprovements for coordinate decompression
Pieter Wuille [Mon, 2 Nov 2015 00:42:53 +0000 (01:42 +0100)]
Improvements for coordinate decompression

9 years agoMerge pull request #347
Pieter Wuille [Sun, 1 Nov 2015 22:01:11 +0000 (23:01 +0100)]
Merge pull request #347

8e48787 Change secp256k1_ec_pubkey_combine's count argument to size_t. (Gregory Maxwell)
c69dea0 Clear output in more cases for pubkey_combine, adds tests. (Gregory Maxwell)
269d422 Comment copyediting. (Gregory Maxwell)

9 years agoChange secp256k1_ec_pubkey_combine's count argument to size_t.
Gregory Maxwell [Sat, 31 Oct 2015 19:04:34 +0000 (19:04 +0000)]
Change secp256k1_ec_pubkey_combine's count argument to size_t.

9 years agoClear output in more cases for pubkey_combine, adds tests.
Gregory Maxwell [Sat, 31 Oct 2015 09:52:30 +0000 (09:52 +0000)]
Clear output in more cases for pubkey_combine, adds tests.

Also corrects an outdated comment and adds an additional
 secp256k1_ecdsa_signature_parse_compact test.

9 years agoComment copyediting.
Gregory Maxwell [Sat, 31 Oct 2015 08:31:15 +0000 (08:31 +0000)]
Comment copyediting.

9 years agoMerge pull request #344
Pieter Wuille [Sat, 31 Oct 2015 01:19:30 +0000 (02:19 +0100)]
Merge pull request #344

26abce7 Adds 32 static test vectors for scalar mul, sqr, inv. (Gregory Maxwell)

9 years agoMerge pull request #345
Pieter Wuille [Fri, 30 Oct 2015 23:30:51 +0000 (00:30 +0100)]
Merge pull request #345

5b71a3f Better error case handling for pubkey_create & pubkey_serialize, more tests. (Gregory Maxwell)

9 years agoAdds 32 static test vectors for scalar mul, sqr, inv.
Gregory Maxwell [Fri, 30 Oct 2015 06:57:30 +0000 (06:57 +0000)]
Adds 32 static test vectors for scalar mul, sqr, inv.

These were generated by testing more than 10^12 random test vectors
 for coverage on instrumented (comparison operator outcomes) 32-bit
 and 64-bit code, plus additional edge condition requirements (e.g.
 inputs of 0, 1, -1) and then solving a minimum set cover problem.

The required responses were generated with Sage.

This significantly improves the lcov branch coverage report and
 makes the tests much more sensitive to mutation testing of the
 scalar code.

The challenges and responses are in the form of pairs of scalars:
  C1 * C2 == R1
  (C1 * C2) * (1 / C2) == C1
  C2 * (1 / C2) == 1
  C1 * C1 == R2
  C1^2    == R2

9 years agoBetter error case handling for pubkey_create & pubkey_serialize, more tests.
Gregory Maxwell [Fri, 30 Oct 2015 09:16:40 +0000 (09:16 +0000)]
Better error case handling for pubkey_create & pubkey_serialize, more tests.

Makes secp256k1_ec_pubkey_serialize set the length to zero on failure,
 also makes secp256k1_ec_pubkey_create set the pubkey to zeros when
 the key argument is NULL.

Also adds many additional ARGCHECK tests.

9 years agoMerge pull request #343
Pieter Wuille [Fri, 30 Oct 2015 01:52:08 +0000 (02:52 +0100)]
Merge pull request #343

eed87af Change contrib/laxder from headers-only to files compilable as standalone C (Andrew Poelstra)

9 years agoChange contrib/laxder from headers-only to files compilable as standalone C
Andrew Poelstra [Mon, 26 Oct 2015 20:21:53 +0000 (15:21 -0500)]
Change contrib/laxder from headers-only to files compilable as standalone C

Verified that both programs compile with

    gcc -I. -I../include -lsecp256k1 -c -W -Wextra -Wall -Werror -ansi -pedantic lax_der_privatekey_parsing.c
    gcc -I. -I../include -lsecp256k1 -c -W -Wextra -Wall -Werror -ansi -pedantic lax_der_parsing.c

9 years agoMerge pull request #342
Pieter Wuille [Mon, 26 Oct 2015 18:47:33 +0000 (19:47 +0100)]
Merge pull request #342

7914a6e Make lax_der_privatekey_parsing.h not depend on internal code (Pieter Wuille)

9 years agoMake lax_der_privatekey_parsing.h not depend on internal code
Pieter Wuille [Mon, 26 Oct 2015 01:51:42 +0000 (02:51 +0100)]
Make lax_der_privatekey_parsing.h not depend on internal code

9 years agoMerge pull request #339
Pieter Wuille [Sun, 25 Oct 2015 19:09:48 +0000 (20:09 +0100)]
Merge pull request #339

9234391 Overhaul flags handling (Pieter Wuille)
1a36898 Make flags more explicit, add runtime checks. (Rusty Russell)

9 years agoOverhaul flags handling
Pieter Wuille [Wed, 21 Oct 2015 15:43:29 +0000 (17:43 +0200)]
Overhaul flags handling

9 years agoMake flags more explicit, add runtime checks.
Rusty Russell [Tue, 29 Sep 2015 04:40:38 +0000 (14:10 +0930)]
Make flags more explicit, add runtime checks.

Signed-off-by: Rusty Russell <[email protected]>
9 years agoMerge pull request #340
Pieter Wuille [Sat, 24 Oct 2015 17:30:12 +0000 (19:30 +0200)]
Merge pull request #340

96be204 Add additional tests for eckey and arg-checks. (Gregory Maxwell)
bb5aa4d Make the tweak function zeroize-output-on-fail behavior consistent. (Gregory Maxwell)
4a243da Move secp256k1_ec_privkey_import/export to contrib. (Gregory Maxwell)
1b3efc1 Move secp256k1_ecdsa_sig_recover into the recovery module. (Gregory Maxwell)
e3cd679 Eliminate all side-effects from VERIFY_CHECK() usage. (Gregory Maxwell)
b30fc85 Avoid nonce_function_rfc6979 algo16 argument emulation. (Gregory Maxwell)
70d4640 Make secp256k1_ec_pubkey_create skip processing invalid secret keys. (Gregory Maxwell)
6c476a8 Minor comment improvements. (Gregory Maxwell)

9 years agoAdd additional tests for eckey and arg-checks.
Gregory Maxwell [Wed, 21 Oct 2015 17:09:41 +0000 (17:09 +0000)]
Add additional tests for eckey and arg-checks.

This gets branch coverage up over 90% for me.

9 years agoMake the tweak function zeroize-output-on-fail behavior consistent.
Gregory Maxwell [Wed, 21 Oct 2015 04:17:05 +0000 (04:17 +0000)]
Make the tweak function zeroize-output-on-fail behavior consistent.

Previously the private key tweak operations left the input unchanged
 on failure but the pubkey versions zeroized on failure.

9 years agoMove secp256k1_ec_privkey_import/export to contrib.
Gregory Maxwell [Wed, 21 Oct 2015 04:02:30 +0000 (04:02 +0000)]
Move secp256k1_ec_privkey_import/export to contrib.

These functions are intended for compatibility with legacy software,
 and are not normally needed in new secp256k1 applications.

They also do not obeying any particular standard (and likely cannot
 without without undermining their compatibility), and so are a
 better fit for contrib.

9 years agoMove secp256k1_ecdsa_sig_recover into the recovery module.
Gregory Maxwell [Tue, 20 Oct 2015 00:32:36 +0000 (00:32 +0000)]
Move secp256k1_ecdsa_sig_recover into the recovery module.

9 years agoEliminate all side-effects from VERIFY_CHECK() usage.
Gregory Maxwell [Mon, 19 Oct 2015 23:55:10 +0000 (23:55 +0000)]
Eliminate all side-effects from VERIFY_CHECK() usage.

The side-effects make review somewhat harder because 99.9% of the
 time the macro usage has no sideeffects, so they're easily ignored.

The main motivation for avoiding the side effects is so that the
 macro can be completely stubbed out for branch coverage analysis
 otherwise all the unreachable verify code gets counted against
 coverage.

9 years agoAvoid nonce_function_rfc6979 algo16 argument emulation.
Gregory Maxwell [Mon, 19 Oct 2015 23:35:29 +0000 (23:35 +0000)]
Avoid nonce_function_rfc6979 algo16 argument emulation.

This avoids data=NULL and data = zeros to producing the same nonce.

Previously the code tried to avoid the case where some data inputs
 aliased algo16 inputs by always padding out the data.

But because algo16 and data are different lengths they cannot
 emulate each other, and the padding would match a data value of
 all zeros.

9 years agoMake secp256k1_ec_pubkey_create skip processing invalid secret keys.
Gregory Maxwell [Mon, 19 Oct 2015 23:30:27 +0000 (23:30 +0000)]
Make secp256k1_ec_pubkey_create skip processing invalid secret keys.

This makes it somewhat less constant time in error conditions, but
 avoids encountering an internal assertion failure when trying
 to write out the point at infinity.

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