902 Commits

Author SHA1 Message Date
Andrew Poelstra
e100037efa
Merge pull request #34 from jonasnick/add-whitelist-md-bip32
Add explanation about how BIP32 unhardened derivation can be used to …
2018-12-04 16:15:14 +00:00
Jonas Nick
0faeeb5dca Add explanation about how BIP32 unhardened derivation can be used to simplify whitelisting 2018-11-26 21:16:49 +00:00
Jonas Nick
809016c819
Merge pull request #19 from jonasnick/surjectionproof_init_p_give_up
Add comment to explain effect of max_n_iterations in surjectionproof_…
2018-10-09 22:01:08 -04:00
Andrew Poelstra
2318f18a90
Merge pull request #31 from apoelstra/2018-10-commit-fix
Fix pedersen commitment serialization after #30 broke it
2018-10-08 05:59:42 +00:00
Andrew Poelstra
cfbe581412 add unit test for generator and pedersen commitment roundtripping 2018-10-08 05:19:10 +00:00
Andrew Poelstra
2285493a5f rangeproof: fix serialization of pedersen commintments 2018-10-08 05:19:10 +00:00
Andrew Poelstra
b2dca3ae19
Merge pull request #30 from apoelstra/2018-09-audit-set-xquad
check the value of `ge_set_xquad` everywhere in -zkp modules
2018-10-04 16:35:38 +00:00
Andrew Poelstra
806fbba755 rangeproof: verify correctness of pedersen commitments when parsing 2018-10-02 18:03:05 +00:00
Andrew Poelstra
4183dc967f generator: verify correctness of point when parsing 2018-10-02 17:58:55 +00:00
Andrew Poelstra
7a72703db3 rangeproof: check that points deserialize correctly when verifying rangeproof 2018-10-02 17:58:55 +00:00
Andrew Poelstra
14b7c4e88a rangeproof: add fixed vector test case 2018-10-02 17:58:55 +00:00
Andrew Poelstra
e38335ad07
Merge pull request #28 from FrankC01/patch-2
Expose generator in shared library
2018-07-25 17:33:30 +00:00
Frank V. Castellucci
6cd43f60bb
Expose generator in shared library
Was failing linking to `*.so` library
2018-07-25 13:30:11 -04:00
Andrew Poelstra
eca632d585
Merge pull request #24 from instagibbs/dicrete
fix spelling in documentation
2018-06-20 15:55:41 +00:00
Gregory Sanders
31c305b466 fix spelling in documentation 2018-06-20 11:48:39 -04:00
Andrew Poelstra
b1458cc914
Merge pull request #22 from real-or-random/rangeproof-trailing
Test for rejection of trailing bytes in range proofs
2018-05-24 12:49:07 +00:00
Tim Ruffing
95c31389fc Test for rejection of trailing bytes in range proofs 2018-05-24 13:29:36 +02:00
Andrew Poelstra
f1c601ed9d
Merge pull request #21 from real-or-random/secp256k1-zkp
Reject surjection proofs with trailing garbage
2018-05-23 14:08:15 +00:00
Tim Ruffing
5fd8271f03 Test for rejection of trailing bytes in surjection proofs 2018-05-23 15:59:01 +02:00
Tim Ruffing
af7d4b0744 Reject surjection proofs with trailing garbage 2018-05-23 14:56:14 +02:00
Andrew Poelstra
874f07791c
Merge pull request #20 from datavetaren/secp256k1-zkp
Minor bugfix. Wrong length due to NUL character.
2018-05-17 00:48:33 +00:00
datavetaren
6e7db6fd3b Minor bugfix. Wrong length due to NUL character. 2018-05-16 05:02:21 +02:00
Jonas Nick
482cceef08 Add comment to explain effect of max_n_iterations in surjectionproof_init 2018-04-17 22:40:51 +00:00
Andrew Poelstra
4b52f125c6
Merge pull request #18 from jonasnick/bench_whitelist
Add whitelisting benchmark
2018-04-17 22:18:59 +00:00
Jonas Nick
410326df67 Add whitelisting benchmark 2018-04-17 22:06:06 +00:00
Gregory Sanders
7b05707c8f add whitelist_impl.h to include for dist 2018-04-05 16:39:34 -07:00
Andrew Poelstra
bad5b3dc92 generator: add API tests 2018-04-05 16:39:34 -07:00
Andrew Poelstra
1c966a2989 generator: remove unnecessary ARG_CHECK from generate() 2018-04-05 16:39:34 -07:00
Gregory Sanders
dd13b2b439 Fix generator makefile
Include test_impl.h
2018-04-05 16:39:34 -07:00
Jonas Nick
e99b7197ed Fix pedersen_blind_generator_blind_sum return value documentation 2018-04-05 16:39:34 -07:00
Jonas Nick
3d6ac31103 Add n_keys argument to whitelist_verify 2018-04-05 16:39:34 -07:00
Jonas Nick
ee1e30de90 Fix checks of whitelist serialize/parse arguments 2018-04-05 16:39:34 -07:00
Andrew Poelstra
c28edd75fc whitelist: fix serialize/parse API to take serialized length 2018-04-05 16:39:34 -07:00
Jonas Nick
c47a60daf9 Fix include/secp256k1_rangeproof.h function argument documentation. 2018-04-05 16:39:34 -07:00
Andrew Poelstra
0ba915f214 rangeproof: add API tests 2018-04-05 16:39:34 -07:00
Andrew Poelstra
1bb1723d4e surjectionproof: rename unit test functions to be more consistent with other modules 2018-04-05 16:39:34 -07:00
Andrew Poelstra
01a8848609 surjectionproof: add API unit tests 2018-04-05 16:39:34 -07:00
Andrew Poelstra
0ca14dcca0 surjectionproof: tests_impl.h s/assert/CHECK/g 2018-04-05 16:39:34 -07:00
Andrew Poelstra
995e5b709f rangeproof: fix memory leak in unit tests 2018-04-05 16:39:34 -07:00
Andrew Poelstra
88e52d6eec add surjection proof module
Includes fix and tests by Jonas Nick.
2018-04-05 16:39:34 -07:00
Andrew Poelstra
1a0ae1b0af Implement ring-signature based whitelist delegation scheme 2018-04-05 16:39:34 -07:00
Andrew Poelstra
f948ca216d rangeproof: several API changes
* add summing function for blinded generators
* drop `excess` and `gen` from `verify_tally`
* add extra_commit to rangeproof sign and verify
2018-04-05 16:39:34 -07:00
Pieter Wuille
c3db107c44 Expose generator in pedersen/rangeproof API 2018-04-05 16:39:34 -07:00
Pieter Wuille
c2f471f11d Constant-time generator module 2018-04-05 16:39:34 -07:00
Andrew Poelstra
5912d2665f rangeproof: expose sidechannel message field in the signing API
Including a fix by Jonas Nick.
2018-04-05 16:39:33 -07:00
Andrew Poelstra
e28302cbd7 [RANGEPROOF BREAK] Use quadratic residue for tie break and modularity cleanup
Switch to secp256k1_pedersen_commitment by Andrew Poelstra.
Switch to quadratic residue based disambiguation by Pieter Wuille.
2018-04-05 16:39:33 -07:00
Andrew Poelstra
e596d3a389 Get rid of precomputed H tables (Pieter Wuille) 2018-04-05 16:39:33 -07:00
Gregory Maxwell
a6dd429dc7 Pedersen commitments, borromean ring signatures, and ZK range proofs.
This commit adds three new cryptosystems to libsecp256k1:

Pedersen commitments are a system for making blinded commitments
 to a value.  Functionally they work like:
  commit_b,v = H(blind_b || value_v),
 except they are additively homorphic, e.g.
  C(b1, v1) - C(b2, v2) = C(b1 - b2, v1 - v2) and
  C(b1, v1) - C(b1, v1) = 0, etc.
 The commitments themselves are EC points, serialized as 33 bytes.
 In addition to the commit function this implementation includes
 utility functions for verifying that a set of commitments sums
 to zero, and for picking blinding factors that sum to zero.
 If the blinding factors are uniformly random, pedersen commitments
 have information theoretic privacy.

Borromean ring signatures are a novel efficient ring signature
 construction for AND/OR admissions policies (the code here implements
 an AND of ORs, each of any size).  This construction requires
 32 bytes of signature per pubkey used plus 32 bytes of constant
 overhead. With these you can construct signatures like "Given pubkeys
 A B C D E F G, the signer knows the discrete logs
 satisifying (A || B) & (C || D || E) & (F || G)".

ZK range proofs allow someone to prove a pedersen commitment is in
 a particular range (e.g. [0..2^64)) without revealing the specific
 value.  The construction here is based on the above borromean
 ring signature and uses a radix-4 encoding and other optimizations
 to maximize efficiency.  It also supports encoding proofs with a
 non-private base-10 exponent and minimum-value to allow trading
 off secrecy for size and speed (or just avoiding wasting space
 keeping data private that was already public due to external
 constraints).

A proof for a 32-bit mantissa takes 2564 bytes, but 2048 bytes of
 this can be used to communicate a private message to a receiver
 who shares a secret random seed with the prover.
2018-04-05 16:39:33 -07:00
Greg Maxwell
26156da781 Add 64-bit integer utilities 2018-04-05 16:39:33 -07:00
Pieter Wuille
452d8e4d2a
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
2018-04-05 16:35:27 -07:00