-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
81 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
#include <string> | ||
|
||
extern bool rust_miniscript_from_str(const char* miniscript_str); | ||
extern bool rust_bitcoin_script(const char* miniscript_str); | ||
extern char* rust_bitcoin_psbt(const char* miniscript_str); | ||
extern bool rust_bitcoin_script(const uint8_t *data, size_t len); | ||
extern char* rust_bitcoin_psbt(const uint8_t *data, size_t len); | ||
extern char* rust_miniscript_from_str_check_key(const char* miniscript_str); | ||
extern char* rust_bitcoin_des_block(const uint8_t *data, size_t len); | ||
extern char* rust_bitcoin_prefilledtransaction(const uint8_t *data, size_t len); | ||
extern bool rust_bitcoin_addrv2(uint8_t *data, size_t len, uint64_t *count); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <fuzzer/FuzzedDataProvider.h> | ||
#include <string> | ||
#include <iostream> | ||
#include <optional> | ||
#include <stdio.h> | ||
|
||
#include "addrv2.h" | ||
#include <cassert> | ||
|
||
extern "C" bool rust_bitcoin_addrv2(uint8_t *data, size_t len, uint64_t *count); | ||
extern "C" bool go_btcd_addrv2(uint8_t *data, size_t len, uint64_t *count); | ||
|
||
void Addrv2(FuzzedDataProvider& provider) | ||
{ | ||
std::vector<uint8_t> buffer{provider.ConsumeRemainingBytes<uint8_t>()}; | ||
uint64_t count_rust = 0, count_btcd = 0; | ||
bool rust_bitcoin{rust_bitcoin_addrv2(buffer.data(), buffer.size(), &count_rust)}; | ||
bool btcd{go_btcd_addrv2(buffer.data(), buffer.size(), &count_btcd)}; | ||
assert(btcd == rust_bitcoin); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#ifndef NET_ADDRESS_H | ||
#define NET_ADDRESS_H | ||
|
||
#include <fuzzer/FuzzedDataProvider.h> | ||
|
||
void Addrv2(FuzzedDataProvider& provider); | ||
#endif |