-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
122 lines (99 loc) · 3.71 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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
CC ?= /usr/bin/cc
CFLAGS += -O2
NISTFLAGS +=
SOURCES = sign.c packing.c polyvec.c poly.c ntt.c reduce.c polymatrix.c
HEADERS = config.h params.h api.h sign.h packing.h polymatrix.h polyvec.h poly.h ntt.h \
reduce.h symmetric.h randombytes.h
KECCAK_SOURCES = $(SOURCES) fips202.c symmetric-shake.c
KECCAK_HEADERS = $(HEADERS) fips202.h
.PHONY: all speed shared clean
all: kats tests shared
kats: \
PQgenKAT_sign3 \
PQgenKAT_sign5 \
tests: \
test/test_eaglesign3 \
test/test_eaglesign5 \
test/test_vectors3 \
test/test_vectors5 \
test/key_recovery3 \
test/key_recovery5
speed: \
test/test_speed3 \
test/test_speed5 \
shared: \
libpq_eaglesign3_ref.so \
libpq_eaglesign5_ref.so \
libpq_fips202_ref.so \
#libpq_aes256ctr_ref.so \
libpq_fips202_ref.so: fips202.c fips202.h
$(CC) -shared -fPIC $(CFLAGS) -o $@ $<
#libpq_aes256ctr_ref.so: aes256ctr.c aes256ctr.h
# $(CC) -shared -fPIC $(CFLAGS) -o $@ $<
libpq_eaglesign3_ref.so: $(SOURCES) $(HEADERS) symmetric-shake.c
$(CC) -shared -fPIC $(CFLAGS) -DEAGLESIGN_MODE=3 \
-o $@ $(SOURCES) symmetric-shake.c
libpq_eaglesign5_ref.so: $(SOURCES) $(HEADERS) symmetric-shake.c
$(CC) -shared -fPIC $(CFLAGS) -DEAGLESIGN_MODE=5 \
-o $@ $(SOURCES) symmetric-shake.c
test/test_eaglesign3: test/test_eaglesign.c randombytes.c $(KECCAK_SOURCES) \
$(KECCAK_HEADERS)
$(CC) $(CFLAGS) -DEAGLESIGN_MODE=3 \
-o $@ $< randombytes.c $(KECCAK_SOURCES)
test/test_eaglesign5: test/test_eaglesign.c randombytes.c $(KECCAK_SOURCES) \
$(KECCAK_HEADERS)
$(CC) $(CFLAGS) -DEAGLESIGN_MODE=5 \
-o $@ $< randombytes.c $(KECCAK_SOURCES)
test/test_vectors3: test/test_vectors.c $(KECCAK_SOURCES) $(KECCAK_HEADERS)
$(CC) $(CFLAGS) -DEAGLESIGN_MODE=3 \
-o $@ $< $(KECCAK_SOURCES)
test/test_vectors5: test/test_vectors.c $(KECCAK_SOURCES) \
$(KECCAK_HEADERS)
$(CC) $(CFLAGS) -DEAGLESIGN_MODE=5 \
-o $@ $< $(KECCAK_SOURCES)
test/test_speed3: test/test_speed.c test/speed_print.c test/speed_print.h \
test/cpucycles.c test/cpucycles.h randombytes.c $(KECCAK_SOURCES) \
$(KECCAK_HEADERS)
$(CC) $(CFLAGS) -DEAGLESIGN_MODE=3 \
-o $@ $< test/speed_print.c test/cpucycles.c randombytes.c \
$(KECCAK_SOURCES)
test/test_speed5: test/test_speed.c test/speed_print.c test/speed_print.h \
test/cpucycles.c test/cpucycles.h randombytes.c $(KECCAK_SOURCES) \
$(KECCAK_HEADERS)
$(CC) $(CFLAGS) -DEAGLESIGN_MODE=5 \
-o $@ $< test/speed_print.c test/cpucycles.c randombytes.c \
$(KECCAK_SOURCES)
test/key_recovery3: test/key_recovery.c test/speed_print.c test/speed_print.h \
test/cpucycles.c test/cpucycles.h randombytes.c $(KECCAK_SOURCES) \
$(KECCAK_HEADERS)
$(CC) $(CFLAGS) -DEAGLESIGN_MODE=3 \
-o $@ $< test/speed_print.c test/cpucycles.c randombytes.c \
$(KECCAK_SOURCES) -lm
test/key_recovery5: test/key_recovery.c test/speed_print.c test/speed_print.h \
test/cpucycles.c test/cpucycles.h randombytes.c $(KECCAK_SOURCES) \
$(KECCAK_HEADERS)
$(CC) $(CFLAGS) -DEAGLESIGN_MODE=5 \
-o $@ $< test/speed_print.c test/cpucycles.c randombytes.c \
$(KECCAK_SOURCES) -lm
PQgenKAT_sign3: PQgenKAT_sign.c rng.c $(KECCAK_SOURCES) \
$(KECCAK_HEADERS)
$(CC) $(NISTFLAGS) -DEAGLESIGN_MODE=3 \
-o $@ $< rng.c $(KECCAK_SOURCES) $(LDFLAGS) -lcrypto
PQgenKAT_sign5: PQgenKAT_sign.c rng.c $(KECCAK_SOURCES) \
$(KECCAK_HEADERS)
$(CC) $(NISTFLAGS) -DEAGLESIGN_MODE=5 \
-o $@ $< rng.c $(KECCAK_SOURCES) $(LDFLAGS) -lcrypto
clean:
rm -f *~ test/*~ *.gcno *.gcda *.lcov
rm -f libpq_eaglesign3_ref.so
rm -f libpq_eaglesign5_ref.so
rm -f libpq_fips202_ref.so
rm -f libpq_aes256ctr_ref.so
rm -f test/test_eaglesign3
rm -f test/test_eaglesign5
rm -f test/test_vectors3
rm -f test/test_vectors5
rm -f test/test_speed3
rm -f test/test_speed5
rm -f PQgenKAT_sign3
rm -f PQgenKAT_sign5