13 Commits

Author SHA1 Message Date
Andrew Poelstra
d1175d265d
surjectionproof: use secp256k1_memcmp_var rather than bare memcmp
Co-authored-by: Tim Ruffing <crypto@timruffing.de>
2022-07-29 21:04:04 +00:00
Andrew Poelstra
bf18ff5a8c surjectionproof: fix generation to fail when any input == the output
Verification will fail in this case, so don't "succeed" in generating a bad proof.
2022-07-26 17:14:49 +00:00
Jonas Nick
938725c1c9 Merge commits 'd7ec49a6 9a5a87e0 aa5d34a8 2a3a97c6 ' into temp-merge-976
Also remove remaining uses of ecmult context in secp-zkp and update API tests
accordingly.
2021-09-16 15:21:11 +00:00
Tim Ruffing
d6738e890e surjection proof: Reject proofs with too many used inputs in reduced mode 2020-07-24 14:59:36 +02:00
Roman Zeyde
bd70820123 allow reducing surjection proof size (to lower generation stack usage) 2020-07-24 14:59:36 +02:00
Andrew Poelstra
56f69d979f surjectionproof: introduce SECP256K1_SURJECTIONPROOF_MAX_USED_INPUTS constant and set it to 16 2020-07-24 14:59:36 +02:00
Andrew Poelstra
b8a3ff5f3b surjectionproof: reduce stack usage 2020-07-24 14:59:36 +02:00
Andrew Poelstra
68d937fe11 surjectionproof: fix malleability in surjection proof parsing 2020-07-24 14:59:36 +02:00
Dmitry Petukhov
00fffeb172 Improve comments for surctionproof init+alloc/destroy funcs
The comments with 'XXX' was intended to indicate that the listed
concerns was subject to review and change, but the code with these
comments was merged straight away. This commit replaces comments
with more complete text describing the issues.

This also signifies that the commit that this code was introduced in is
not anymore 'work in progress'.
2020-07-24 14:59:36 +02:00
Dmitry Petukhov
2dc868f35b work in progress: add _allocate_initialized/destroy funcs 2020-07-24 14:59:36 +02:00
Tim Ruffing
949e994cb3 Reject surjection proofs with trailing garbage 2020-07-24 14:50:48 +02:00
Andrew Poelstra
5f1ad03d00 surjectionproof: add API unit tests 2020-07-24 14:49:33 +02:00
Andrew Poelstra
ba8b4f53ef add surjection proof module
Includes fix and tests by Jonas Nick.
2020-07-24 14:49:33 +02:00