Skip to content

Commit 0b2d97f

Browse files
committed
habemus secp256k1
1 parent e2b85d7 commit 0b2d97f

File tree

182 files changed

+68865
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+68865
-10
lines changed

Makefile

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ HEADERS := $(wildcard $(shell find bitcoin -type f -name '*.h')) targets/bech32
33
SOURCES := $(wildcard $(shell find bitcoin -type f -name '*.cpp')) targets/bech32.cpp targets/tx_des.cpp targets/miniscript_string.cpp targets/block_des.cpp targets/prefilledtransaction.cpp
44
OBJS := $(patsubst %.cpp, build/%.o, $(SOURCES))
55
UNAME_S := $(shell uname -s)
6-
CXXFLAGS := -O3 -g0 -Wall -fsanitize=fuzzer -DHAVE_GMTIME_R=1 -std=c++20 -march=native -Ibitcoin
7-
LDFLAGS := -L rust_bitcoin_lib/target/debug -L btcd_lib -lbtcd_wrapper -lrust_bitcoin_lib -lpthread -ldl
6+
INCLUDE_DIR = bitcoin/secp256k1/include
7+
LIB_DIR = bitcoin/secp256k1/.libs
8+
CXXFLAGS := -O3 -g0 -Wall -fsanitize=fuzzer -DHAVE_GMTIME_R=1 -std=c++20 -march=native -Ibitcoin -I$(INCLUDE_DIR)
9+
LDFLAGS := -L rust_bitcoin_lib/target/debug -L btcd_lib -lbtcd_wrapper -lrust_bitcoin_lib -lpthread -ldl -L$(LIB_DIR) -lsecp256k1
810

911
ifeq ($(UNAME_S),Darwin)
1012
LDFLAGS += -framework CoreFoundation -Wl,-ld_classic
1113
endif
1214

13-
bitcoinfuzz: set $(OBJS) cargo go
15+
bitcoinfuzz: set $(OBJS) libsecp256 cargo go
1416
$(CXX) fuzzer.cpp -o $@ $(OBJS) $(CXXFLAGS) $(LDFLAGS)
1517

1618
$(OBJS) : build/%.o: %.cpp
@@ -24,6 +26,9 @@ cargo:
2426
-C llvm-args='-sanitizer-coverage-pc-table' \
2527
-C llvm-args='-sanitizer-coverage-level=3'
2628

29+
libsecp256:
30+
cd bitcoin/secp256k1 && ./autogen.sh && ./configure --enable-module-schnorrsig --enable-benchmark=no --enable-module-recovery --enable-static --disable-shared --enable-tests=no --enable-ctime-tests=no --enable-benchmark=no && make
31+
2732
go:
2833
cd dependencies/btcd/wire && go build -tags=libfuzzer -gcflags=all=-d=libfuzzer .
2934
cd btcd_lib && go build -o libbtcd_wrapper.a -buildmode=c-archive -tags=libfuzzer -gcflags=all=-d=libfuzzer wrapper.go

bitcoin/compat/byteswap.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#define BITCOIN_COMPAT_BYTESWAP_H
77

88
#if defined(HAVE_CONFIG_H)
9-
#include <config/bitcoin-config.h>
9+
1010
#endif
1111

1212
#include <stdint.h>

bitcoin/compat/compat.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#define BITCOIN_COMPAT_COMPAT_H
88

99
#if defined(HAVE_CONFIG_H)
10-
#include <config/bitcoin-config.h>
10+
1111
#endif
1212

1313
// Windows defines FD_SETSIZE to 64 (see _fd_types.h in mingw-w64),

bitcoin/compat/endian.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#define BITCOIN_COMPAT_ENDIAN_H
77

88
#if defined(HAVE_CONFIG_H)
9-
#include <config/bitcoin-config.h>
9+
1010
#endif
1111

1212
#include <compat/byteswap.h>

0 commit comments

Comments
 (0)