Commit | Line | Data |
---|---|---|
0f00dc4c MW |
1 | ### -*-makefile-*- |
2 | ### | |
3 | ### Build script for symmetric cryptography | |
4 | ### | |
5 | ### (c) 2013 Straylight/Edgeware | |
6 | ### | |
7 | ||
8 | ###----- Licensing notice --------------------------------------------------- | |
9 | ### | |
10 | ### This file is part of Catacomb. | |
11 | ### | |
12 | ### Catacomb is free software; you can redistribute it and/or modify | |
13 | ### it under the terms of the GNU Library General Public License as | |
14 | ### published by the Free Software Foundation; either version 2 of the | |
15 | ### License, or (at your option) any later version. | |
16 | ### | |
17 | ### Catacomb is distributed in the hope that it will be useful, | |
18 | ### but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | ### GNU Library General Public License for more details. | |
21 | ### | |
22 | ### You should have received a copy of the GNU Library General Public | |
23 | ### License along with Catacomb; if not, write to the Free | |
24 | ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, | |
25 | ### MA 02111-1307, USA. | |
26 | ||
27 | include $(top_srcdir)/vars.am | |
28 | ||
29 | noinst_LTLIBRARIES = libsymm.la | |
30 | libsymm_la_SOURCES = | |
31 | nodist_libsymm_la_SOURCES = | |
32 | ||
33 | TEST_LIBS = libsymm.la | |
34 | ||
e5b61a8d | 35 | VPATH += $(srcdir)/modes |
0f00dc4c MW |
36 | |
37 | ###-------------------------------------------------------------------------- | |
38 | ### Autogenerated lists. | |
39 | ||
40 | ## Fancy template substitutions. | |
41 | multigen = $(PYTHON) $(srcdir)/multigen | |
42 | EXTRA_DIST += multigen | |
43 | ||
44 | ## The heart of this is an enormous cross-product of crypto primitives and | |
45 | ## the corresponding modes of operation. Rather than write it out longhand, | |
46 | ## we generate it using `multigen'. Unfortunately, this needs to be done | |
47 | ## at the Automake level, which causes some interesting bootstrapping | |
48 | ## problems. | |
24497005 MW |
49 | ## |
50 | ## Of course, now that we have this machinery for the complicated modes | |
51 | ## generation, we might as well use it for simpler things. | |
0f00dc4c | 52 | include modes.am |
24497005 | 53 | include stubs.am |
0f00dc4c MW |
54 | |
55 | EXTRA_DIST += modes.am.in modes.am | |
24497005 | 56 | EXTRA_DIST += stubs.am.in stubs.am |
0f00dc4c | 57 | MAINTAINERCLEANFILES += $(srcdir)/modes.am |
24497005 | 58 | MAINTAINERCLEANFILES += $(srcdir)/stubs.am |
0f00dc4c MW |
59 | |
60 | ## Generate the lists. | |
77843a37 | 61 | $(srcdir)/modes.am: modes.am.in Makefile.am |
0f00dc4c MW |
62 | $(AM_V_GEN)$(multigen) -g $(srcdir)/modes.am.in $(srcdir)/modes.am \ |
63 | blkc="$(BLKCS)" \ | |
64 | blkcmode="$(BLKCMODES)" \ | |
65 | blkcciphermode="$(BLKCCIPHERMODES)" \ | |
66 | hash="$(HASHES)" \ | |
67 | hashmode="$(HASHMODES)" \ | |
68 | hashciphermode="$(HASHCIPHERMODES)" \ | |
69 | hashmacmode="$(HASHMACMODES)" | |
24497005 MW |
70 | $(srcdir)/stubs.am: stubs.am.in Makefile.am |
71 | $(AM_V_GEN)$(multigen) -g $(srcdir)/stubs.am.in $(srcdir)/stubs.am \ | |
72 | descr,hname,base="$(STUBS_HDR)" cname="$(STUBS_SRC)" | |
0f00dc4c MW |
73 | |
74 | ## Initialize lists of known classes. | |
75 | ALL_CIPHERS = $(CIPHER_MODES) | |
76 | ALL_HASHES = $(HASHES) | |
77 | ALL_MACS = $(MAC_MODES) | |
78 | ||
24497005 MW |
79 | ## Stub headers and sources. |
80 | STUBS_HDR = | |
81 | STUBS_SRC = | |
82 | ||
0f00dc4c MW |
83 | ###-------------------------------------------------------------------------- |
84 | ### Block ciphers. | |
85 | ||
86 | BLKCS = | |
87 | BLKCMODES = | |
88 | ||
89 | BLKCCIPHERMODES = | |
90 | BLKCMODES += $(BLKCCIPHERMODES) | |
91 | ||
92 | ## A tool for translating the AES-contest test vectors into a form our test | |
93 | ## rigs understand. | |
94 | EXTRA_DIST += aes-trans | |
95 | ||
96 | ## Block cipher utility macros, mainly used in mode implementations. | |
97 | pkginclude_HEADERS += blkc.h | |
98 | ||
99 | ## Source code and headers for the block ciphers. | |
100 | libsymm_la_SOURCES += $(BLKC_C) | |
101 | pkginclude_HEADERS += $(BLKC_H) | |
102 | ||
103 | ## Schneier's `Blowfish' block cipher. | |
104 | BLKCS += blowfish | |
e5b61a8d MW |
105 | libsymm_la_SOURCES += $(precomp)/blowfish-tab.c |
106 | PRECOMPS += $(precomp)/blowfish-tab.c | |
107 | PRECOMP_PROGS += blowfish-mktab | |
0f00dc4c | 108 | blowfish_mktab_CPPFLAGS = $(AM_CPPFLAGS) -DQUIET |
e5b61a8d MW |
109 | if !CROSS_COMPILING |
110 | $(precomp)/blowfish-tab.c: | |
111 | $(AM_V_at)$(MKDIR_P) $(precomp) | |
112 | $(AM_V_at)$(MAKE) blowfish-mktab$e | |
113 | $(AM_V_GEN)./blowfish-mktab >$(precomp)/blowfish-tab.c.new && \ | |
114 | mv $(precomp)/blowfish-tab.c.new $(precomp)/blowfish-tab.c | |
115 | endif | |
0f00dc4c MW |
116 | |
117 | ## Adams and Tavares' `CAST' block ciphers. | |
118 | BLKCS += cast128 cast256 | |
e5b61a8d | 119 | libsymm_la_SOURCES += cast-s.c cast-sk.c cast-base.h |
0f00dc4c MW |
120 | cast256.$t: t/cast256 |
121 | EXTRA_DIST += t/cast256.aes | |
122 | MAINTAINERCLEANFILES += $(srcdir)/t/cast256 | |
123 | t/cast256: t/cast256.aes | |
124 | $(AM_V_GEN)$(srcdir)/aes-trans CAST256 \ | |
125 | <$(srcdir)/t/cast256.aes \ | |
126 | >$(srcdir)/t/cast256.new && \ | |
127 | mv $(srcdir)/t/cast256.new $(srcdir)/t/cast256 | |
128 | ||
129 | ## IBM's `DES' block cipher, by Feistel, Coppersmith, and others. | |
130 | BLKCS += des des3 | |
e5b61a8d MW |
131 | libsymm_la_SOURCES += des-base.h $(precomp)/des-tab.c |
132 | PRECOMPS += $(precomp)/des-tab.c | |
133 | PRECOMP_PROGS += des-mktab | |
134 | if !CROSS_COMPILING | |
135 | $(precomp)/des-tab.c: | |
136 | $(AM_V_at)$(MKDIR_P) $(precomp) | |
137 | $(AM_V_at)$(MAKE) des-mktab$e | |
138 | $(AM_V_GEN)./des-mktab >$(precomp)/des-tab.c.new && \ | |
139 | mv $(precomp)/des-tab.c.new $(precomp)/des-tab.c | |
140 | endif | |
0f00dc4c MW |
141 | |
142 | ## Rivest's `DESX' variant, with pre- and post-whitening. | |
143 | BLKCS += desx | |
e5b61a8d | 144 | libsymm_la_SOURCES += desx-tab.c |
0f00dc4c MW |
145 | |
146 | ## Lai and Massey's IDEA. | |
147 | BLKCS += idea | |
148 | ||
149 | ## IBM's `MARS' block cipher. | |
150 | BLKCS += mars | |
e5b61a8d MW |
151 | libsymm_la_SOURCES += $(precomp)/mars-tab.c |
152 | PRECOMPS += $(precomp)/mars-tab.c | |
153 | PRECOMP_PROGS += mars-mktab | |
154 | if !CROSS_COMPILING | |
155 | $(precomp)/mars-tab.c: | |
156 | $(AM_V_at)$(MKDIR_P) $(precomp) | |
157 | $(AM_V_at)$(MAKE) mars-mktab$e | |
158 | $(AM_V_GEN)./mars-mktab >$(precomp)/mars-tab.c.new && \ | |
159 | mv $(precomp)/mars-tab.c.new $(precomp)/mars-tab.c | |
160 | endif | |
0f00dc4c MW |
161 | mars.$t: t/mars |
162 | EXTRA_DIST += t/mars.aes | |
163 | MAINTAINERCLEANFILES += $(srcdir)/t/mars | |
164 | t/mars: t/mars.aes | |
165 | $(AM_V_GEN)$(srcdir)/aes-trans Mars \ | |
166 | <$(srcdir)/t/mars.aes \ | |
167 | >$(srcdir)/t/mars.new && \ | |
168 | mv $(srcdir)/t/mars.new $(srcdir)/t/mars | |
169 | ||
170 | ## Daemen, Peeters, Van Assche and Rijmen's `Noekeon'. | |
171 | BLKCS += noekeon | |
172 | ||
173 | ## Rivest's `RC2' block cipher. | |
174 | BLKCS += rc2 | |
e5b61a8d | 175 | libsymm_la_SOURCES += rc2-tab.c |
0f00dc4c MW |
176 | |
177 | ## Rivest's `RC5'. | |
178 | BLKCS += rc5 | |
179 | ||
180 | ## Daemen and Rijmen's `Rijndael' block cipher, selected as AES. | |
181 | BLKCS += rijndael rijndael192 rijndael256 | |
182 | libsymm_la_SOURCES += rijndael-base.h rijndael-base.c | |
e5b61a8d MW |
183 | libsymm_la_SOURCES += $(precomp)/rijndael-tab.c |
184 | PRECOMPS += $(precomp)/rijndael-tab.c | |
185 | PRECOMP_PROGS += rijndael-mktab | |
186 | if !CROSS_COMPILING | |
187 | $(precomp)/rijndael-tab.c: | |
188 | $(AM_V_at)$(MKDIR_P) $(precomp) | |
189 | $(AM_V_at)$(MAKE) rijndael-mktab$e | |
190 | $(AM_V_GEN)./rijndael-mktab >$(precomp)/rijndael-tab.c.new && \ | |
191 | mv $(precomp)/rijndael-tab.c.new $(precomp)/rijndael-tab.c | |
192 | endif | |
0f00dc4c MW |
193 | rijndael.$t: t/rijndael |
194 | EXTRA_DIST += t/rijndael.aes | |
195 | MAINTAINERCLEANFILES += $(srcdir)/t/rijndael | |
196 | t/rijndael: t/rijndael.aes | |
197 | $(AM_V_GEN)$(srcdir)/aes-trans Rijndael \ | |
198 | <$(srcdir)/t/rijndael.aes \ | |
199 | >$(srcdir)/t/rijndael.new && \ | |
200 | mv $(srcdir)/t/rijndael.new $(srcdir)/t/rijndael | |
201 | ||
202 | ## Massey's `SAFER' block ciphers. | |
203 | BLKCS += safer safersk | |
e5b61a8d MW |
204 | libsymm_la_SOURCES += $(precomp)/safer-tab.c |
205 | PRECOMPS += $(precomp)/safer-tab.c | |
206 | PRECOMP_PROGS += safer-mktab | |
24497005 | 207 | STUBS_HDR += SAFER-SK,safersk,safer |
e5b61a8d MW |
208 | if !CROSS_COMPILING |
209 | $(precomp)/safer-tab.c: | |
210 | $(AM_V_at)$(MKDIR_P) $(precomp) | |
211 | $(AM_V_at)$(MAKE) safer-mktab$e | |
212 | $(AM_V_GEN)./safer-mktab >$(precomp)/safer-tab.c.new && \ | |
213 | mv $(precomp)/safer-tab.c.new $(precomp)/safer-tab.c | |
214 | endif | |
0f00dc4c MW |
215 | |
216 | ## Anderson, Biham and Knudsen's `Serpent' block cipher. | |
217 | BLKCS += serpent | |
218 | libsymm_la_SOURCES += serpent-sbox.h | |
e5b61a8d | 219 | check_PROGRAMS += serpent-check |
0f00dc4c MW |
220 | TESTS += serpent-check |
221 | serpent.$t: t/serpent | |
222 | EXTRA_DIST += t/serpent.aes | |
223 | MAINTAINERCLEANFILES += $(srcdir)/t/serpent | |
224 | t/serpent: t/serpent.aes | |
225 | $(AM_V_GEN)$(srcdir)/aes-trans Serpent -v rev=1 \ | |
226 | <$(srcdir)/t/serpent.aes \ | |
227 | >$(srcdir)/t/serpent.new && \ | |
228 | mv $(srcdir)/t/serpent.new $(srcdir)/t/serpent | |
229 | ||
230 | ## The National Security Agency's `Skipjack' block cipher. You don't want to | |
231 | ## use this. | |
232 | BLKCS += skipjack | |
e5b61a8d | 233 | libsymm_la_SOURCES += skipjack-tab.c |
0f00dc4c MW |
234 | |
235 | ## Daemen and Rijmen's `Square' block cipher. | |
236 | BLKCS += square | |
e5b61a8d MW |
237 | libsymm_la_SOURCES += $(precomp)/square-tab.c |
238 | PRECOMPS += $(precomp)/square-tab.c | |
239 | PRECOMP_PROGS += square-mktab | |
240 | if !CROSS_COMPILING | |
241 | $(precomp)/square-tab.c: | |
242 | $(AM_V_at)$(MKDIR_P) $(precomp) | |
243 | $(AM_V_at)$(MAKE) square-mktab$e | |
244 | $(AM_V_GEN)./square-mktab >$(precomp)/square-tab.c.new && \ | |
245 | mv $(precomp)/square-tab.c.new $(precomp)/square-tab.c | |
246 | endif | |
0f00dc4c MW |
247 | |
248 | ## Wheeler and Needham's `TEA' and `XTEA' block ciphers. | |
249 | BLKCS += tea xtea | |
250 | ||
251 | ## Schneier, Kelsey, Whiting, Wagner, Hall and Ferguson's `Twofish' block | |
252 | ## cipher. | |
253 | BLKCS += twofish | |
e5b61a8d MW |
254 | libsymm_la_SOURCES += $(precomp)/twofish-tab.c |
255 | PRECOMPS += $(precomp)/twofish-tab.c | |
256 | PRECOMP_PROGS += twofish-mktab | |
257 | if !CROSS_COMPILING | |
258 | $(precomp)/twofish-tab.c: | |
259 | $(AM_V_at)$(MKDIR_P) $(precomp) | |
260 | $(AM_V_at)$(MAKE) twofish-mktab$e | |
261 | $(AM_V_GEN)./twofish-mktab >$(precomp)/twofish-tab.c.new && \ | |
262 | mv $(precomp)/twofish-tab.c.new $(precomp)/twofish-tab.c | |
263 | endif | |
0f00dc4c MW |
264 | twofish.$t: t/twofish |
265 | EXTRA_DIST += t/twofish.aes | |
266 | MAINTAINERCLEANFILES += $(srcdir)/t/twofish | |
267 | t/twofish: t/twofish.aes | |
268 | $(AM_V_GEN)$(srcdir)/aes-trans Twofish \ | |
269 | <$(srcdir)/t/twofish.aes \ | |
270 | >$(srcdir)/t/twofish.new && \ | |
271 | mv $(srcdir)/t/twofish.new $(srcdir)/t/twofish | |
272 | ||
273 | ## The old NIST modes for DES. | |
274 | BLKCCIPHERMODES += cbc cfb ecb ofb | |
275 | ||
276 | ## Counter mode. | |
277 | BLKCCIPHERMODES += counter | |
278 | ||
279 | ###-------------------------------------------------------------------------- | |
280 | ### Hash functions. | |
281 | ||
282 | HASHES = | |
283 | HASHMODES = | |
284 | ||
285 | HASHCIPHERMODES = | |
286 | HASHMODES += $(HASHCIPHERMODES) | |
287 | ||
288 | HASHMACMODES = | |
289 | HASHMODES += $(HASHMACMODES) | |
290 | ||
291 | ## Common definitions for hash functions. | |
292 | pkginclude_HEADERS += hash.h | |
293 | ||
294 | ## Source code and headers for the hash functions. | |
295 | libsymm_la_SOURCES += $(HASH_C) | |
296 | pkginclude_HEADERS += $(HASH_H) | |
297 | ||
298 | ## Lim and KISA's `HAS-160', recommended for use with KCDSA. | |
299 | HASHES += has160 | |
300 | ||
301 | ## Rivest's `MD' series of hash functions | |
302 | HASHES += md2 md4 md5 | |
e5b61a8d | 303 | libsymm_la_SOURCES += md2-tab.c |
0f00dc4c MW |
304 | |
305 | ## Dobbertin, Bosselaers and Preneel's `RIPEMD' suite. | |
306 | HASHES += rmd128 rmd160 rmd256 rmd320 | |
307 | ||
308 | ## The National Security Agency's `SHA-1' hash function. | |
309 | HASHES += sha | |
310 | ||
311 | ## The National Security Agency's `SHA-2' suite. | |
312 | HASHES += sha224 sha256 | |
313 | HASHES += sha384 sha512 | |
24497005 MW |
314 | STUBS_HDR += SHA-224,sha224,sha256 |
315 | STUBS_HDR += SHA-384,sha384,sha512 | |
0f00dc4c MW |
316 | |
317 | ## Anderson and Biham's `Tiger' hash function. | |
318 | HASHES += tiger | |
e5b61a8d MW |
319 | libsymm_la_SOURCES += tiger-base.h $(precomp)/tiger-tab.c |
320 | PRECOMPS += $(precomp)/tiger-tab.c | |
321 | PRECOMP_PROGS += tiger-mktab | |
322 | if !CROSS_COMPILING | |
323 | $(precomp)/tiger-tab.c: | |
324 | $(AM_V_at)$(MKDIR_P) $(precomp) | |
325 | $(AM_V_at)$(MAKE) tiger-mktab$e | |
326 | $(AM_V_GEN)./tiger-mktab >$(precomp)/tiger-tab.c.new && \ | |
327 | mv $(precomp)/tiger-tab.c.new $(precomp)/tiger-tab.c | |
328 | endif | |
0f00dc4c MW |
329 | |
330 | ## Barreto and Rijmen's `Whirlpool' hash function. | |
331 | HASHES += whirlpool whirlpool256 | |
e5b61a8d MW |
332 | libsymm_la_SOURCES += $(precomp)/whirlpool-tab.c |
333 | PRECOMPS += $(precomp)/whirlpool-tab.c | |
334 | PRECOMP_PROGS += whirlpool-mktab | |
24497005 | 335 | STUBS_HDR += Whirlpool-256,whirlpool256,whirlpool |
e5b61a8d MW |
336 | if !CROSS_COMPILING |
337 | $(precomp)/whirlpool-tab.c: | |
338 | $(AM_V_at)$(MKDIR_P) $(precomp) | |
339 | $(AM_V_at)$(MAKE) whirlpool-mktab$e | |
340 | $(AM_V_GEN)./whirlpool-mktab >$(precomp)/whirlpool-tab.c.new && \ | |
341 | mv $(precomp)/whirlpool-tab.c.new $(precomp)/whirlpool-tab.c | |
342 | endif | |
0f00dc4c MW |
343 | |
344 | ## Bellare, Canetti and Krawczyk's `HMAC' mode for message authentication. | |
345 | HASHMACMODES += hmac | |
346 | ||
347 | ## MGF1, used in OAEP and PSS. | |
348 | HASHCIPHERMODES += mgf | |
349 | ||
350 | ###-------------------------------------------------------------------------- | |
351 | ### Other symmetric primitives. | |
352 | ||
353 | ## The CRC32 algorithm, which is useful, but has no worthwhile security. | |
354 | pkginclude_HEADERS += crc32.h | |
355 | libsymm_la_SOURCES += crc32.c | |
356 | ALL_HASHES += crc32=gcrc32 | |
357 | ||
358 | ## Rivest's `RC4' stream cipher. | |
359 | pkginclude_HEADERS += rc4.h | |
360 | libsymm_la_SOURCES += rc4.c | |
361 | TESTS += rc4.$t | |
362 | EXTRA_DIST += t/rc4 | |
363 | ALL_CIPHERS += rc4 | |
364 | ||
365 | ## Coppersmith and Rogaway's `SEAL' pseudorandom function. | |
366 | pkginclude_HEADERS += seal.h | |
367 | libsymm_la_SOURCES += seal.c | |
368 | TESTS += seal.$t | |
369 | EXTRA_DIST += t/seal | |
370 | ALL_CIPHERS += seal | |
371 | ||
194e93f2 MW |
372 | ## Bernstein's `Salsa20' stream cipher. Most of the test vectors come from |
373 | ## the eSTREAM project, captured by the Internet Archive's Wayback Machine at | |
374 | ## | |
375 | ## http://web.archive.org/web/20070814004154/http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20.tar.gz?view=tar | |
376 | ## | |
377 | ## and automatically converted into the format we want. | |
378 | EXTRA_DIST += salsa20-tvconv | |
379 | pkginclude_HEADERS += salsa20.h salsa20-core.h | |
380 | libsymm_la_SOURCES += salsa20.c | |
381 | TESTS += salsa20.$t | |
382 | ALL_CIPHERS += salsa20 salsa2012 salsa208 | |
383 | ALL_CIPHERS += xsalsa20 xsalsa2012 xsalsa208 | |
384 | STUBS_HDR += Salsa20/12,salsa2012,salsa20 | |
385 | STUBS_HDR += Salsa20/8,salsa208,salsa20 | |
386 | STUBS_HDR += XSalsa20,xsalsa20,salsa20 | |
387 | STUBS_HDR += XSalsa20/12,xsalsa2012,salsa20 | |
388 | STUBS_HDR += XSalsa20/8,xsalsa208,salsa20 | |
389 | EXTRA_DIST += t/salsa20 | |
390 | MAINTAINERCLEANFILES += t/salsa20 | |
391 | salsa20.$t: t/salsa20 | |
392 | SALSA20_ESTREAM_TV = t/salsa20.estream | |
393 | SALSA20_ESTREAM_TV += t/salsa2012.estream | |
394 | SALSA20_ESTREAM_TV += t/salsa208.estream | |
395 | EXTRA_DIST += t/salsa20.local $(SALSA20_ESTREAM_TV) | |
396 | t/salsa20: salsa20-tvconv t/salsa20.local $(SALSA20_ESTREAM_TV) | |
397 | $(AM_V_GEN)cd $(srcdir) && \ | |
398 | { echo "### GENERATED by salsa20-tvconv" && \ | |
399 | cat t/salsa20.local && \ | |
400 | ./salsa20-tvconv $(SALSA20_ESTREAM_TV); \ | |
401 | } >t/salsa20.new && \ | |
402 | mv t/salsa20.new t/salsa20 | |
403 | ||
55d81656 MW |
404 | ## Bernstein's `ChaCha' stream cipher. |
405 | pkginclude_HEADERS += chacha.h chacha-core.h | |
406 | libsymm_la_SOURCES += chacha.c | |
407 | TESTS += chacha.$t | |
408 | EXTRA_DIST += t/chacha | |
409 | ALL_CIPHERS += chacha20 chacha12 chacha8 | |
410 | ALL_CIPHERS += xchacha20 xchacha12 xchacha8 | |
411 | STUBS_HDR += ChaCha20,chacha20,chacha | |
412 | STUBS_HDR += ChaCha12,chacha12,chacha | |
413 | STUBS_HDR += ChaCha8,chacha8,chacha | |
414 | STUBS_HDR += XChaCha20,xchacha20,chacha | |
415 | STUBS_HDR += XChaCha12,xchacha12,chacha | |
416 | STUBS_HDR += XChaCha8,xchacha8,chacha | |
417 | ||
0f00dc4c MW |
418 | ###-------------------------------------------------------------------------- |
419 | ### Autogenerated mode implementations. | |
420 | ||
421 | ## The master stamp file, indicating that we generated all of the sources. | |
0f00dc4c | 422 | EXTRA_DIST += mode.h.in mode.c.in |
e5b61a8d MW |
423 | EXTRA_DIST += modes/gen-stamp |
424 | MAINTAINERCLEANFILES += modes/gen-stamp | |
77843a37 | 425 | modes/gen-stamp: Makefile.am |
e5b61a8d | 426 | $(AM_V_at)$(MKDIR_P) $(srcdir)/modes |
0f00dc4c | 427 | $(AM_V_GEN)$(multigen) -g $(srcdir)/mode.c.in \ |
e5b61a8d | 428 | $(srcdir)/modes/@base-@mode.c \ |
0f00dc4c MW |
429 | base="$(BLKCS)" mode="$(BLKCMODES)" |
430 | $(AM_V_at)$(multigen) -g $(srcdir)/mode.h.in \ | |
e5b61a8d | 431 | $(srcdir)/modes/@base-@mode.h \ |
0f00dc4c MW |
432 | base="$(BLKCS)" mode="$(BLKCMODES)" |
433 | $(AM_V_at)$(multigen) -g $(srcdir)/mode.c.in \ | |
e5b61a8d | 434 | $(srcdir)/modes/@base-@mode.c \ |
0f00dc4c MW |
435 | base="$(HASHES)" mode="$(HASHMODES)" |
436 | $(AM_V_at)$(multigen) -g $(srcdir)/mode.h.in \ | |
e5b61a8d | 437 | $(srcdir)/modes/@base-@mode.h \ |
0f00dc4c | 438 | base="$(HASHES)" mode="$(HASHMODES)" |
e5b61a8d | 439 | $(AM_V_at)touch $(srcdir)/modes/gen-stamp |
0f00dc4c MW |
440 | |
441 | ## The individual mode interfaces and implementations. | |
442 | pkginclude_HEADERS += $(MODE_H) | |
443 | ||
444 | ## Generated implementations. | |
445 | BUILT_SOURCES += $(GENMODES_C) | |
e5b61a8d | 446 | MAINTAINERCLEANFILES += $(GENMODES_C) |
ef75f314 | 447 | libsymm_la_SOURCES += $(GENMODES_C) |
0f00dc4c MW |
448 | $(GENMODES_C): modes/gen-stamp |
449 | ||
450 | ## Generated interfaces. | |
451 | BUILT_SOURCES += $(GENMODES_H) | |
e5b61a8d | 452 | MAINTAINERCLEANFILES += $(GENMODES_H) |
ef75f314 | 453 | pkginclude_HEADERS += $(GENMODES_H) |
0f00dc4c MW |
454 | $(GENMODES_H): modes/gen-stamp |
455 | ||
456 | ###-------------------------------------------------------------------------- | |
24497005 MW |
457 | ### Autogenerated stub headers. |
458 | ||
459 | ## The master stamp file. | |
460 | EXTRA_DIST += stub.h.in | |
461 | EXTRA_DIST += stubs.gen-stamp | |
462 | MAINTAINERCLEANFILES += stubs.gen-stamp | |
463 | stubs.gen-stamp: Makefile.am | |
464 | $(AM_V_at)$(MKDIR_P) $(srcdir)/stubs | |
465 | $(AM_V_GEN)$(multigen) -g $(srcdir)/stub.h.in \ | |
466 | $(srcdir)/@name.h descr,name,base="$(STUBS_HDR)" | |
467 | $(AM_V_GEN)$(multigen) -g $(srcdir)/stub.c.in \ | |
468 | $(srcdir)/@name.c name="$(STUBS_SRC)" | |
469 | $(AM_V_at)touch $(srcdir)/stubs.gen-stamp | |
470 | ||
471 | ## Generated stub headers. | |
472 | BUILT_SOURCES += $(STUB_H) $(STUB_C) | |
473 | MAINTAINERCLEANFILES += $(STUB_H) $(STUB_C) | |
474 | pkginclude_HEADERS += $(STUB_H) | |
475 | $(STUB_H) $(STUB_C): stubs.gen-stamp | |
476 | ||
477 | ###-------------------------------------------------------------------------- | |
0f00dc4c MW |
478 | ### Tables of classes for encryption, hashing, and message authentication. |
479 | ||
480 | ## The skeleton for the class tables. | |
481 | EXTRA_DIST += gthingtab.c.in | |
482 | ||
483 | ## Table of cipher classes. | |
484 | pkginclude_HEADERS += gcipher.h | |
485 | CLEANFILES += gciphertab.c | |
486 | nodist_libsymm_la_SOURCES += gciphertab.c | |
77843a37 | 487 | gciphertab.c: gthingtab.c.in Makefile.am |
0f00dc4c MW |
488 | $(AM_V_GEN)$(multigen) -g $(srcdir)/gthingtab.c.in gciphertab.c \ |
489 | what=gcipher cls=gccipher thing="$(ALL_CIPHERS)" | |
490 | ||
491 | ## Table of hash classes. | |
492 | pkginclude_HEADERS += ghash.h ghash-def.h | |
493 | CLEANFILES += ghashtab.c | |
494 | nodist_libsymm_la_SOURCES += ghashtab.c | |
77843a37 | 495 | ghashtab.c: gthingtab.c.in Makefile.am |
0f00dc4c MW |
496 | $(AM_V_GEN)$(multigen) -g $(srcdir)/gthingtab.c.in ghashtab.c \ |
497 | what=ghash cls=gchash thing="$(ALL_HASHES)" | |
498 | ||
499 | ## Table of MAC classes. | |
500 | pkginclude_HEADERS += gmac.h | |
501 | CLEANFILES += gmactab.c | |
502 | nodist_libsymm_la_SOURCES += gmactab.c | |
77843a37 | 503 | gmactab.c: gthingtab.c.in Makefile.am |
0f00dc4c MW |
504 | $(AM_V_GEN)$(multigen) -g $(srcdir)/gthingtab.c.in gmactab.c \ |
505 | what=gmac cls=gcmac thing="$(ALL_MACS)" | |
506 | ||
507 | ###-------------------------------------------------------------------------- | |
508 | ### Testing. | |
509 | ||
510 | ## Run the test programs. | |
511 | TESTS += $(SYMM_TESTS) | |
512 | EXTRA_DIST += $(SYMM_TEST_FILES) | |
513 | ||
514 | ## A piece of sample text for round-trip testing encryption modes. | |
515 | EXTRA_DIST += daftstory.h | |
516 | ||
517 | ## Clean the debris from the `modes' subdirectory. | |
518 | CLEANFILES += modes/*.to modes/*.$t | |
519 | ||
520 | ###----- That's all, folks -------------------------------------------------- |