forked from vladkens/ecloop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
107 lines (85 loc) · 3.48 KB
/
Makefile
File metadata and controls
107 lines (85 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
.PHONY: default clean build bench fmt add mul rnd blf remote
CC = clang
CC_FLAGS ?= -O3 -ffast-math -Wall -Wextra -lcurl
ifeq ($(shell uname -m),x86_64)
CC_FLAGS += -march=native -pthread -lpthread
endif
default: build
clean:
@rm -rf ecloop bench main a.out *.profraw *.profdata
build: clean
$(CC) $(CC_FLAGS) main.c -o ecloop
bench: build
./ecloop bench
fmt:
@find . -name '*.c' | xargs clang-format -i
# -----------------------------------------------------------------------------
add: build
./ecloop add -f data/btc-puzzles-hash -r 8000:ffffff
mul: build
cat data/btc-bw-priv | ./ecloop mul -f data/btc-bw-hash -a cu -q -o /dev/null
rnd: build
./ecloop rnd -f data/btc-puzzles-hash -r 800000000000000000:ffffffffffffffffff -d 0:32
blf: build
@rm -rf /tmp/test.blf
@printf "\n> "
cat data/btc-puzzles-hash | ./ecloop blf-gen -n 32768 -o /tmp/test.blf
@printf "\n> "
cat data/btc-bw-hash | ./ecloop blf-gen -n 32768 -o /tmp/test.blf
@printf "\n> "
./ecloop add -f /tmp/test.blf -r 8000:ffffff -q -o /dev/null
@printf "\n> "
cat data/btc-bw-priv | ./ecloop mul -f /tmp/test.blf -a cu -q -o /dev/null
verify: build
./ecloop mult-verify
# -----------------------------------------------------------------------------
# https://btcpuzzle.info/puzzle
# -----------------------------------------------------------------------------
# Notify URL if BC_API_SHARE is set
ifdef BC_API_SHARE
NOTIFY_ARG = -notify_url $(BC_API_SHARE)
endif
range_28 = 8000000:fffffff
range_32 = 80000000:ffffffff
range_33 = 100000000:1ffffffff
range_34 = 200000000:3ffffffff
range_35 = 400000000:7ffffffff
range_36 = 800000000:fffffffff
range_71 = 400000000000000000:7fffffffffffffffff
range_72 = 800000000000000000:ffffffffffffffffff
range_73 = 1000000000000000000:1ffffffffffffffffff
range_74 = 2000000000000000000:3ffffffffffffffffff
range_76 = 8000000000000000000:fffffffffffffffffff
range_77 = 10000000000000000000:1fffffffffffffffffff
range_78 = 20000000000000000000:3fffffffffffffffffff
range_79 = 40000000000000000000:7fffffffffffffffffff
_RANGES_ = $(foreach r,$(filter range_%,$(.VARIABLES)),$(patsubst range_%,%,$r))
puzzle: build
@$(if $(filter $(_RANGES_),$(n)),,$(error "Invalid range $(n)"))
./ecloop rnd -f data/btc-puzzles-hash -d 0:36 -r $(range_$(n)) -o ./found_$(n).txt $(NOTIFY_ARG)
%:
@$(if $(filter $(_RANGES_),$@),make --no-print-directory puzzle n=$@,)
# -----------------------------------------------------------------------------
host=mele
cmd=add
remote:
@rsync -arc --progress --delete-after --exclude={'ecloop','found*.txt','.git'} ./ $(host):/tmp/ecloop
@ssh -tt $(host) 'clear; $(CC) --version'
ssh -tt $(host) 'cd /tmp/ecloop; make $(cmd) CC=$(CC)'
bench-compare:
@ssh -tt $(host) " \
cd /tmp; rm -rf ecloop keyhunt; \
cd /tmp && git clone https://github.com/vladkens/ecloop.git && cd ecloop && make CC=clang; \
echo '--------------------------------------------------'; \
cd /tmp && git clone https://github.com/albertobsd/keyhunt.git && cd keyhunt && make; \
echo '--------------------------------------------------'; \
cd /tmp; \
echo '--- t=1 (keyhunt)'; \
time ./keyhunt/keyhunt -m rmd160 -f ecloop/data/btc-bw-hash -r 8000:fffffff -t 1 -n 16777216; \
echo '--- t=1 (ecloop)'; \
time ./ecloop/ecloop add -f ecloop/data/btc-bw-hash -t 1 -r 8000:fffffff; \
echo '--- t=4 (keyhunt)'; \
time ./keyhunt/keyhunt -m rmd160 -f ecloop/data/btc-bw-hash -r 8000:fffffff -t 4 -n 16777216; \
echo '--- t=4 (ecloop)'; \
time ./ecloop/ecloop add -f ecloop/data/btc-bw-hash -t 4 -r 8000:fffffff; \
"