elements/src/test/fuzz
Andrew Chow 679f825ba3
Merge bitcoin/bitcoin#27479: BIP324: ElligatorSwift integrations
3168b08043 Bench test for EllSwift ECDH (Pieter Wuille)
42d759f239 Bench tests for CKey->EllSwift (dhruv)
2e5a8a437c Fuzz test for Ellswift ECDH (dhruv)
c3ac9f5cf4 Fuzz test for CKey->EllSwift->CPubKey creation/decoding (dhruv)
aae432a764 Unit test for ellswift creation/decoding roundtrip (dhruv)
eff72a0dff Add ElligatorSwift key creation and ECDH logic (Pieter Wuille)
42239f8390 Enable ellswift module in libsecp256k1 (dhruv)
901336eee7 Squashed 'src/secp256k1/' changes from 4258c54f4e..705ce7ed8c (Pieter Wuille)

Pull request description:

  This replaces #23432 and part of #23561.

  This PR introduces all of the ElligatorSwift-related changes (libsecp256k1 updates, generation, decoding, ECDH, tests, fuzzing, benchmarks) needed for BIP324.

  ElligatorSwift is a special 64-byte encoding format for public keys introduced in libsecp256k1 in https://github.com/bitcoin-core/secp256k1/pull/1129. It has the property that *every* 64-byte array is a valid encoding for some public key, and every key has approximately $2^{256}$ encodings. Furthermore, it is possible to efficiently generate a uniformly random encoding for a given public key or private key. This is used for the key exchange phase in BIP324, to achieve a byte stream that is entirely pseudorandom, even before the shared encryption key is established.

ACKs for top commit:
  instagibbs:
    reACK https://github.com/bitcoin/bitcoin/pull/27479/commits/3168b08043546cd248a81563e21ff096019f1521
  achow101:
    ACK 3168b08043
  theStack:
    re-ACK 3168b08043

Tree-SHA512: 308ac3d33e9a2deecb65826cbf0390480a38de201918429c35c796f3421cdf94c5501d027a043ae8f012cfaa0584656da1de6393bfba3532ab4c20f9533f06a6
2023-06-26 17:08:03 -04:00
..
util scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
addition_overflow.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
addrman.cpp refactor: Replace string chain name constants with ChainTypes 2023-05-09 15:49:14 +02:00
asmap.cpp [netgroupman] Add GetMappedAS() and GetGroup() 2022-04-20 14:35:52 +01:00
asmap_direct.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
autofile.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
banman.cpp move-only: Extract common/args and common/config.cpp from util/system 2023-04-19 10:48:30 +02:00
base_encode_decode.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
bech32.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
bitdeque.cpp fuzz: Avoid timeout in bitdeque fuzz target 2022-09-05 15:38:33 +02:00
block.cpp refactor: Replace string chain name constants with ChainTypes 2023-05-09 15:49:14 +02:00
block_header.cpp
blockfilter.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
bloom_filter.cpp fuzz: replace every fuzzer-controlled loop with a LIMITED_WHILE loop 2021-11-12 19:51:55 +00:00
buffered_file.cpp util: improve streams.h:FindByte() performance 2023-05-05 06:03:17 -06:00
chain.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
checkqueue.cpp refactor: Use move semantics in CCheckQueue::Loop 2023-03-21 13:04:21 +00:00
coins_view.cpp scripted-diff: Remove unused chainparamsbase includes 2023-05-09 15:49:19 +02:00
coinscache_sim.cpp Exercise non-DIRTY spent coins in caches in fuzz test 2023-02-03 10:33:31 -05:00
connman.cpp scripted-diff: Remove unused chainparamsbase includes 2023-05-09 15:49:19 +02:00
crypto.cpp fuzz: Use LIMITED_WHILE instead of limit_max_ops 2021-08-21 19:25:33 +02:00
crypto_aes256.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
crypto_aes256cbc.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
crypto_chacha20.cpp Only support 32-byte keys in ChaCha20{,Aligned} 2023-01-30 18:12:21 -05:00
crypto_chacha20_poly1305_aead.cpp Move AdditionOverflow to util, Add CheckedAdd with unit tests 2021-12-17 10:46:39 +01:00
crypto_common.cpp
crypto_diff_fuzz_chacha20.cpp Inline ChaCha20 32-byte specific constants 2023-01-30 18:12:21 -05:00
crypto_hkdf_hmac_sha256_l32.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
crypto_poly1305.cpp
cuckoocache.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
decode_tx.cpp
descriptor_parse.cpp refactor: Replace string chain name constants with ChainTypes 2023-05-09 15:49:14 +02:00
deserialize.cpp move-only: Extract common/args and common/config.cpp from util/system 2023-04-19 10:48:30 +02:00
eval_script.cpp Adapt to libsecp256k1 API changes 2022-12-13 15:08:24 -05:00
fee_rate.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
fees.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
flatfile.cpp Refactor: Remove unused FlatFilePos::SetNull 2023-03-21 13:54:11 +01:00
float.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
fuzz.cpp fuzz: Print error message when FUZZ is missing 2023-05-22 10:02:29 +02:00
fuzz.h fuzz: Use LIMITED_WHILE instead of limit_max_ops 2021-08-21 19:25:33 +02:00
FuzzedDataProvider.h fuzz: Bump FuzzedDataProvider.h 2021-03-09 12:56:44 +01:00
golomb_rice.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
headerssync.cpp refactor: Replace string chain name constants with ChainTypes 2023-05-09 15:49:14 +02:00
hex.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
http_request.cpp Merge bitcoin/bitcoin#25619: net: avoid overriding non-virtual ToString() in CService and use better naming 2023-02-17 13:34:40 -05:00
i2p.cpp move-only: Extract common/args and common/config.cpp from util/system 2023-04-19 10:48:30 +02:00
integer.cpp refactor: Move system from util to common library 2023-05-20 12:08:13 +02:00
key.cpp Fuzz test for Ellswift ECDH 2023-06-23 14:22:39 -04:00
key_io.cpp refactor: Replace string chain name constants with ChainTypes 2023-05-09 15:49:14 +02:00
kitchen_sink.cpp make ParseOutputType return a std::optional<OutputType> 2021-08-04 19:20:32 +08:00
load_external_block_file.cpp refactor: Make mapBlocksUnknownParent local, and rename it 2022-07-18 12:06:14 -06:00
locale.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
merkleblock.cpp fuzz: replace every fuzzer-controlled loop with a LIMITED_WHILE loop 2021-11-12 19:51:55 +00:00
message.cpp refactor: Replace string chain name constants with ChainTypes 2023-05-09 15:49:14 +02:00
mini_miner.cpp fuzz: Fix mini_miner_selection running out of coin 2023-06-12 14:19:53 -04:00
miniscript.cpp ci: use clang-16 in tidy task 2023-04-05 11:43:42 +01:00
minisketch.cpp Add src/node/* code to node:: namespace 2022-01-06 22:14:16 -05:00
muhash.cpp fuzz: Cleanup muhash fuzz target 2021-09-22 10:39:08 +02:00
multiplication_overflow.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
net.cpp scripted-diff: Remove unused chainparamsbase includes 2023-05-09 15:49:19 +02:00
net_permissions.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
netaddress.cpp Merge bitcoin/bitcoin#25619: net: avoid overriding non-virtual ToString() in CService and use better naming 2023-02-17 13:34:40 -05:00
netbase_dns_lookup.cpp p2p, refactor: return std::optional<CNetAddr> in LookupHost 2023-05-26 13:41:07 -03:00
node_eviction.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
p2p_transport_serialization.cpp refactor: Replace string chain name constants with ChainTypes 2023-05-09 15:49:14 +02:00
parse_hd_keypath.cpp Switch hardened derivation marker to h in descriptors 2023-04-04 18:33:08 +02:00
parse_numbers.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
parse_script.cpp
parse_univalue.cpp Merge bitcoin/bitcoin#27256: refactor: rpc: Remove unnecessary uses of ParseNonRFCJSONValue() and rename it 2023-06-02 16:18:11 +01:00
partially_downloaded_block.cpp [fuzz] Assert that omitting missing transactions always fails block reconstruction 2023-01-23 17:29:41 +01:00
policy_estimator.cpp tx fees, policy: read stale fee estimates with a regtest-only option 2023-06-14 22:39:26 +01:00
policy_estimator_io.cpp tx fees, policy: read stale fee estimates with a regtest-only option 2023-06-14 22:39:26 +01:00
poolresource.cpp Add PoolResource fuzzer 2023-03-23 19:38:38 +01:00
pow.cpp refactor: Replace string chain name constants with ChainTypes 2023-05-09 15:49:14 +02:00
prevector.cpp Use DataStream where possible 2023-01-26 10:44:05 +01:00
primitives_transaction.cpp
process_message.cpp fuzz: Change LIMIT_TO_MESSAGE_TYPE from a compile-time to a run-time setting 2023-05-26 17:14:23 +02:00
process_messages.cpp refactor: Replace string chain name constants with ChainTypes 2023-05-09 15:49:14 +02:00
protocol.cpp
psbt.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
random.cpp
rbf.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
rolling_bloom_filter.cpp scripted-diff: Move bloom to src/common 2021-10-05 11:10:37 +02:00
rpc.cpp Merge bitcoin/bitcoin#27501: mempool / rpc: add getprioritisedtransactions, delete a mapDeltas entry when delta==0 2023-06-07 03:29:05 -04:00
script.cpp refactor: Replace string chain name constants with ChainTypes 2023-05-09 15:49:14 +02:00
script_assets_test_minimizer.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
script_bitcoin_consensus.cpp
script_descriptor_cache.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
script_flags.cpp Adapt to libsecp256k1 API changes 2022-12-13 15:08:24 -05:00
script_format.cpp refactor: Replace string chain name constants with ChainTypes 2023-05-09 15:49:14 +02:00
script_interpreter.cpp
script_ops.cpp fuzz: replace every fuzzer-controlled loop with a LIMITED_WHILE loop 2021-11-12 19:51:55 +00:00
script_sigcache.cpp scripted-diff: Remove unused chainparamsbase includes 2023-05-09 15:49:19 +02:00
script_sign.cpp scripted-diff: Remove unused chainparamsbase includes 2023-05-09 15:49:19 +02:00
scriptnum_ops.cpp fuzz: replace every fuzzer-controlled loop with a LIMITED_WHILE loop 2021-11-12 19:51:55 +00:00
secp256k1_ec_seckey_import_export_der.cpp
secp256k1_ecdsa_signature_parse_der_lax.cpp Adapt to libsecp256k1 API changes 2022-12-13 15:08:24 -05:00
signature_checker.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
signet.cpp refactor: Replace string chain name constants with ChainTypes 2023-05-09 15:49:14 +02:00
socks5.cpp net: Use steady clock in InterruptibleRecv 2023-04-04 12:33:49 +02:00
span.cpp
spanparsing.cpp
string.cpp Merge bitcoin/bitcoin#27576: kernel: Remove args, settings, chainparams, chainparamsbase from kernel library 2023-06-09 14:58:49 -04:00
strprintf.cpp fuzz: Remove strprintf test cases that are known to fail 2021-05-09 10:25:21 +02:00
system.cpp refactor: Move system from util to common library 2023-05-20 12:08:13 +02:00
timedata.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
torcontrol.cpp fuzz: replace every fuzzer-controlled loop with a LIMITED_WHILE loop 2021-11-12 19:51:55 +00:00
transaction.cpp fuzz: Avoid OOM in transaction fuzz target 2023-06-21 07:51:29 +02:00
tx_in.cpp Use DataStream where possible 2023-01-26 10:44:05 +01:00
tx_out.cpp Use DataStream where possible 2023-01-26 10:44:05 +01:00
tx_pool.cpp test: Add util to mine invalid blocks 2023-05-02 17:17:06 +02:00
txorphan.cpp Merge bitcoin/bitcoin#26551: p2p: Track orphans by who provided them 2023-01-26 10:36:18 +00:00
txrequest.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
util.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
util.h scripted-diff: Remove unused chainparamsbase includes 2023-05-09 15:49:19 +02:00
utxo_snapshot.cpp refactor: Replace string chain name constants with ChainTypes 2023-05-09 15:49:14 +02:00
utxo_total_supply.cpp [fuzz] Only check duplicate coinbase script when block was valid 2023-06-03 15:37:11 +02:00
validation_load_mempool.cpp scripted-diff: Remove unused chainparamsbase includes 2023-05-09 15:49:19 +02:00
versionbits.cpp refactor: Replace string chain name constants with ChainTypes 2023-05-09 15:49:14 +02:00