forked from open-quantum-safe/liboqs
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.am
254 lines (224 loc) · 6.63 KB
/
Makefile.am
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I config
# DOXYGEN SUPPORT
include aminclude.am
# ensure the distribution of the doxygen configuration file
EXTRA_DIST = doxygen.cfg
CLANGFORMAT ?= clang-format-3.9
SUBDIRS = ${SRCDIR}
BUILT_SOURCES = links
lib_LTLIBRARIES = liboqs.la
liboqs_la_SOURCES =
liboqs_la_LIBADD = src/common/libcommon.la
liboqs_la_LIBADD += src/crypto/aes/libaes.la
liboqs_la_LIBADD += src/crypto/rand/librand.la
liboqs_la_LIBADD += src/crypto/rand_urandom_aesctr/librandaesctr.la
liboqs_la_LIBADD += src/crypto/rand_urandom_chacha20/librandchacha20.la
liboqs_la_LIBADD += src/crypto/sha3/libsha3.la
liboqs_la_LIBADD += src/kex/libkex.la
if USE_KEX_RLWE_NEWHOPE_AVX2
liboqs_la_LIBADD += src/kex_rlwe_newhope/avx2/libnewhope_avx2.la
endif
if USE_KEX_LWE_FRODO
liboqs_la_LIBADD += src/kex_lwe_frodo/libfrodo.la
endif
if USE_KEX_NTRU
liboqs_la_LIBADD += src/kex_ntru/libntru.la
endif
liboqs_la_LIBADD += src/kex_rlwe_bcns15/libbcns15.la
if USE_KEX_RLWE_MSRLN16
liboqs_la_LIBADD += src/kex_rlwe_msrln16/libmsrln16.la
endif
if USE_KEX_RLWE_NEWHOPE
liboqs_la_LIBADD += src/kex_rlwe_newhope/libnewhope.la
endif
if USE_KEX_SIDH_MSR
liboqs_la_LIBADD += src/kex_sidh_msr/libsidhmsr.la
endif
liboqs_la_LIBADD += src/sig/libsig.la
if USE_MCBITS
liboqs_la_LIBADD += src/kex_code_mcbits/libmcbits.la
endif
if USE_SIDH_IQC
liboqs_la_LIBADD += src/kex_sidh_iqc_ref/libsidhiqc.la
endif
if USE_SIG_PICNIC
liboqs_la_LIBADD += src/sig_picnic/libpicnic_i.la
endif
installheaderdir=$(includedir)/oqs
installheader_HEADERS=config.h \
src/common/oqs.h \
src/common/common.h \
src/crypto/aes/aes.h \
src/crypto/rand/rand.h \
src/crypto/rand_urandom_aesctr/rand_urandom_aesctr.h \
src/crypto/rand_urandom_chacha20/rand_urandom_chacha20.h \
src/crypto/sha3/sha3.h \
src/kex/kex.h \
src/kex_lwe_frodo/kex_lwe_frodo.h \
src/kex_ntru/kex_ntru.h \
src/kex_rlwe_bcns15/kex_rlwe_bcns15.h \
src/kex_rlwe_msrln16/kex_rlwe_msrln16.h \
src/kex_rlwe_newhope/kex_rlwe_newhope.h \
src/kex_sidh_msr/kex_sidh_msr.h \
src/sig/sig.h
install-exec-local:
if USE_KEX_RLWE_NEWHOPE_AVX2
bash patches/apply-patch.sh kex_rlwe_newhope_avx2
endif
install-exec-hook:
mkdir -p $(includedir)/oqs
if USE_KEX_RLWE_NEWHOPE_AVX2
cp src/kex_rlwe_newhope/avx2/kex_rlwe_newhope_avx2.h $(includedir)/oqs
bash patches/cleanup-patch.sh kex_rlwe_newhope/avx2
endif
if USE_OPENSSL
cp src/sig_picnic/external/Picnic-master/picnic.h $(includedir)/oqs
endif
if USE_MCBITS
cp src/kex_code_mcbits/kex_code_mcbits.h $(includedir)/oqs
endif
if USE_SIDH_IQC
cp src/kex_sidh_iqc_ref/kex_sidh_iqc_ref.h $(includedir)/oqs
endif
noinst_bin_PROGRAMS = test_kex test_aes test_rand test_sha3
if USE_KEX_LWE_FRODO
noinst_bin_PROGRAMS += minimal_kex_oqs
endif
if USE_SIG_PICNIC
noinst_bin_PROGRAMS += test_sig minimal_sig_oqs
endif
noinst_bindir=$(prefix)/tests
test_kex_LDADD = liboqs.la -lm
test_kex_SOURCES = src/kex/test_kex.c
test_kex_CPPFLAGS = -I./include
test_kex_CPPFLAGS += $(AM_CPPFLAGS)
if USE_MCBITS
test_kex_LDADD += -L${SODIUM_DIR}/lib -lsodium
endif
if USE_OPENSSL
test_kex_LDADD += -L$(OPENSSL_DIR)/lib -lcrypto
endif
if USE_SIDH_IQC
test_kex_LDADD += -L$(GMP_DIR)/lib -lgmp
endif
if USE_SIG_PICNIC
test_sig_LDADD = liboqs.la -lm
test_sig_SOURCES = src/sig/test_sig.c
test_sig_CPPFLAGS = -I./include
test_sig_CPPFLAGS += $(AM_CPPFLAGS)
if USE_OPENSSL
test_sig_LDADD += -L$(OPENSSL_DIR)/lib -lcrypto
endif
minimal_sig_oqs_LDADD = liboqs.la -lm
minimal_sig_oqs_SOURCES = src/sig/minimal_sig_oqs.c
minimal_sig_oqs_CPPFLAGS = -I./include
minimal_sig_oqs_CPPFLAGS += $(AM_CPPFLAGS)
if USE_OPENSSL
minimal_sig_oqs_LDADD += -L$(OPENSSL_DIR)/lib -lcrypto
endif
endif # USE_SIG_PICNIC
if USE_KEX_LWE_FRODO
minimal_kex_oqs_LDADD = liboqs.la -lm
minimal_kex_oqs_SOURCES = src/kex/minimal_kex_oqs.c
minimal_kex_oqs_CPPFLAGS = -I./include
minimal_kex_oqs_CPPFLAGS += $(AM_CPPFLAGS)
if USE_MCBITS
minimal_kex_oqs_LDADD += -L${SODIUM_DIR}/lib -lsodium
endif
if USE_OPENSSL
minimal_kex_oqs_LDADD += -L$(OPENSSL_DIR)/lib -lcrypto
endif
if USE_SIDH_IQC
minimal_kex_oqs_LDADD += -L$(GMP_DIR)/lib -lgmp
endif
endif # USE_KEX_LWE_FRODO
test_aes_LDADD = liboqs.la -lm
test_aes_SOURCES = src/crypto/aes/test_aes.c
test_aes_CPPFLAGS = -I./include
test_aes_CPPFLAGS += $(AM_CPPFLAGS)
if USE_OPENSSL
test_aes_LDADD += -L$(OPENSSL_DIR)/lib -lcrypto
endif
test_rand_SOURCES = src/crypto/rand/test_rand.c
test_rand_CPPFLAGS = -Iinclude -Isrc/crypto/rand_urandom_aesctr/
test_rand_CPPFLAGS += $(AM_CPPFLAGS)
test_rand_LDADD = liboqs.la
if USE_OPENSSL
test_rand_LDADD += -L$(OPENSSL_DIR)/lib -lcrypto
else
if USE_AES_NI
test_rand_CPPFLAGS += -maes -msse2
endif
endif # USE_OPENSSL
test_sha3_LDADD = liboqs.la -lm
test_sha3_SOURCES = src/crypto/sha3/test_sha3.c
test_sha3_CPPFLAGS = -I./include
test_sha3_CPPFLAGS += $(AM_CPPFLAGS)
test: clean-tests
make
./test_kex --quiet
./test_rand --quiet
./test_aes
./test_sha3
if USE_SIG_PICNIC
./test_sig
./minimal_sig_oqs
endif
if USE_KEX_LWE_FRODO
./minimal_kex_oqs
endif
links:
$(MKDIR_P) include/oqs
cp -f config.h include/oqs
cp -f src/common/oqs.h include/oqs
cp -f src/common/common.h include/oqs
cp -f src/crypto/aes/aes.h include/oqs
cp -f src/crypto/rand/rand.h include/oqs
cp -f src/crypto/rand_urandom_aesctr/rand_urandom_aesctr.h include/oqs
cp -f src/crypto/rand_urandom_chacha20/rand_urandom_chacha20.h include/oqs
cp -f src/crypto/sha3/sha3.h include/oqs
cp -f src/kex/kex.h include/oqs
cp -f src/kex_lwe_frodo/kex_lwe_frodo.h include/oqs
cp -f src/kex_ntru/kex_ntru.h include/oqs
cp -f src/kex_rlwe_bcns15/kex_rlwe_bcns15.h include/oqs
cp -f src/kex_rlwe_msrln16/kex_rlwe_msrln16.h include/oqs
cp -f src/kex_rlwe_newhope/kex_rlwe_newhope.h include/oqs
if USE_KEX_RLWE_NEWHOPE_AVX2
bash patches/apply-patch.sh kex_rlwe_newhope_avx2
cp -f src/kex_rlwe_newhope/avx2/kex_rlwe_newhope_avx2.h include/oqs
endif
cp -f src/kex_sidh_msr/kex_sidh_msr.h include/oqs
cp -f src/sig/sig.h include/oqs
cp -f src/sig_picnic/sig_picnic.h include/oqs
$(LN_S) -f .libs/liboqs.a
if USE_MCBITS
cp -f src/kex_code_mcbits/kex_code_mcbits.h include/oqs
endif
if USE_SIDH_IQC
cp -f src/kex_sidh_iqc_ref/kex_sidh_iqc_ref.h include/oqs
$(LN_S) -f src/kex_sidh_iqc_ref/sample_params
endif
clean-local:
rm -f liboqs.a
rm -rf include
if USE_KEX_LWE_FRODO
rm -f minimal_kex_oqs
endif
if USE_SIG_PICNIC
rm -f test_sig
rm -f minimal_sig_oqs
endif
if USE_SIDH_IQC
rm -f sample_params
endif
clean-tests:
rm -f test_kex test_rand test_aes test_sha3
prettyprint:
find src -name '*.c' -o -name '*.h' | grep -v sig_picnic/external* | grep -v "kex_rlwe_newhope/avx2" | grep -v "kex_sidh_msr" | xargs $(CLANGFORMAT) -style=file -i
docs: links
doxygen
cleanup-patch:
if USE_KEX_RLWE_NEWHOPE_AVX2
bash patches/cleanup-patch.sh kex_rlwe_newhope/avx2
endif