forked from alxdavids/voprf-poc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (56 loc) · 1.13 KB
/
Makefile
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
TEST_FLAGS=./... -cover -count=1
BENCH_FLAGS=$(TEST_FLAGS) -bench=.
COMPILED=voprf-go
BUILD_FLAGS=-o $(COMPILED)
# defaults
GROUP=P384
H2C=SSWU-RO
ifeq ($(GROUP),curve448)
H2C=ELL2-RO
endif
SUFFIX=$(GROUP)-HKDF-SHA512-$(H2C)
MAX_EVALS=10
N=3
# check verifiability
PREFIX=VOPRF
ifndef VERIFIABLE
ifndef TEST
PREFIX=OPRF
endif
endif
CIPHERSUITE=$(PREFIX)-$(SUFFIX)
# args
CIPHERSUITE_ARG=--ciph=$(CIPHERSUITE)
MAX_EVALS_ARG=--max_evals=$(MAX_EVALS)
N_ARG=--n=$(N)
PK_ARG=--pk=$(PUBLIC_KEY)
CLIENT_MODE=--mode=client
SERVER_MODE=--mode=server
CLIENT_ARGS=$(CLIENT_MODE) $(N_ARG) $(CIPHERSUITE_ARG)
SERVER_ARGS=$(SERVER_MODE) $(MAX_EVALS_ARG) $(CIPHERSUITE_ARG)
ifdef VERIFIABLE
CLIENT_ARGS+=$(PK_ARG)
endif
ifdef TEST
TEST_ARG=--test=$(TEST)
CLIENT_ARGS=$(CLIENT_MODE) $(CIPHERSUITE_ARG) $(TEST_ARG)
SERVER_ARGS=$(SERVER_MODE) $(CIPHERSUITE_ARG) $(TEST_ARG)
endif
.PHONY: build
build:
go build $(BUILD_FLAGS)
.PHONY: test
test:
go test $(TEST_FLAGS)
.PHONY: bench
bench:
go test $(BENCH_FLAGS)
.PHONY: docs
docs:
./docs.sh
.PHONY: server
server: build
./$(COMPILED) $(SERVER_ARGS)
.PHONY: client
client: build
./$(COMPILED) $(CLIENT_ARGS)