base/dispatch.c: Add notional support for `AT_HWCAP2' entry.
[catacomb] / symm / Makefile.am
CommitLineData
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
27include $(top_srcdir)/vars.am
28
29noinst_LTLIBRARIES = libsymm.la
30libsymm_la_SOURCES =
31nodist_libsymm_la_SOURCES =
32
33TEST_LIBS = libsymm.la
34
e5b61a8d 35VPATH += $(srcdir)/modes
0f00dc4c
MW
36
37###--------------------------------------------------------------------------
38### Autogenerated lists.
39
40## Fancy template substitutions.
41multigen = $(PYTHON) $(srcdir)/multigen
42EXTRA_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 52include modes.am
24497005 53include stubs.am
0f00dc4c
MW
54
55EXTRA_DIST += modes.am.in modes.am
24497005 56EXTRA_DIST += stubs.am.in stubs.am
0f00dc4c 57MAINTAINERCLEANFILES += $(srcdir)/modes.am
24497005 58MAINTAINERCLEANFILES += $(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.
75ALL_CIPHERS = $(CIPHER_MODES)
76ALL_HASHES = $(HASHES)
77ALL_MACS = $(MAC_MODES)
78
24497005
MW
79## Stub headers and sources.
80STUBS_HDR =
81STUBS_SRC =
82
0f00dc4c
MW
83###--------------------------------------------------------------------------
84### Block ciphers.
85
86BLKCS =
87BLKCMODES =
88
89BLKCCIPHERMODES =
90BLKCMODES += $(BLKCCIPHERMODES)
91
92## A tool for translating the AES-contest test vectors into a form our test
93## rigs understand.
94EXTRA_DIST += aes-trans
95
96## Block cipher utility macros, mainly used in mode implementations.
97pkginclude_HEADERS += blkc.h
98
99## Source code and headers for the block ciphers.
100libsymm_la_SOURCES += $(BLKC_C)
101pkginclude_HEADERS += $(BLKC_H)
102
103## Schneier's `Blowfish' block cipher.
104BLKCS += blowfish
c9cfa678
MW
105nodist_libsymm_la_SOURCES += ../precomp/symm/blowfish-tab.c
106PRECOMPS += $(precomp)/symm/blowfish-tab.c
e5b61a8d 107PRECOMP_PROGS += blowfish-mktab
0f00dc4c 108blowfish_mktab_CPPFLAGS = $(AM_CPPFLAGS) -DQUIET
e5b61a8d 109if !CROSS_COMPILING
c9cfa678
MW
110$(precomp)/symm/blowfish-tab.c:
111 $(AM_V_at)$(MKDIR_P) $(precomp)/symm
ba57d652 112 $(AM_V_at)$(MAKE) blowfish-mktab$(EXEEXT)
c9cfa678
MW
113 $(AM_V_GEN)./blowfish-mktab >$(precomp)/symm/blowfish-tab.c.new && \
114 mv $(precomp)/symm/blowfish-tab.c.new \
115 $(precomp)/symm/blowfish-tab.c
e5b61a8d 116endif
0f00dc4c
MW
117
118## Adams and Tavares' `CAST' block ciphers.
119BLKCS += cast128 cast256
e5b61a8d 120libsymm_la_SOURCES += cast-s.c cast-sk.c cast-base.h
ba57d652 121cast256.t$(EXEEXT): t/cast256
0f00dc4c
MW
122EXTRA_DIST += t/cast256.aes
123MAINTAINERCLEANFILES += $(srcdir)/t/cast256
124t/cast256: t/cast256.aes
125 $(AM_V_GEN)$(srcdir)/aes-trans CAST256 \
126 <$(srcdir)/t/cast256.aes \
127 >$(srcdir)/t/cast256.new && \
128 mv $(srcdir)/t/cast256.new $(srcdir)/t/cast256
129
130## IBM's `DES' block cipher, by Feistel, Coppersmith, and others.
131BLKCS += des des3
c9cfa678
MW
132libsymm_la_SOURCES += des-base.h
133nodist_libsymm_la_SOURCES += ../precomp/symm/des-tab.c
134PRECOMPS += $(precomp)/symm/des-tab.c
e5b61a8d
MW
135PRECOMP_PROGS += des-mktab
136if !CROSS_COMPILING
c9cfa678
MW
137$(precomp)/symm/des-tab.c:
138 $(AM_V_at)$(MKDIR_P) $(precomp)/symm
ba57d652 139 $(AM_V_at)$(MAKE) des-mktab$(EXEEXT)
c9cfa678
MW
140 $(AM_V_GEN)./des-mktab >$(precomp)/symm/des-tab.c.new && \
141 mv $(precomp)/symm/des-tab.c.new $(precomp)/symm/des-tab.c
e5b61a8d 142endif
0f00dc4c
MW
143
144## Rivest's `DESX' variant, with pre- and post-whitening.
145BLKCS += desx
e5b61a8d 146libsymm_la_SOURCES += desx-tab.c
0f00dc4c
MW
147
148## Lai and Massey's IDEA.
149BLKCS += idea
150
151## IBM's `MARS' block cipher.
152BLKCS += mars
c9cfa678
MW
153nodist_libsymm_la_SOURCES += ../precomp/symm/mars-tab.c
154PRECOMPS += $(precomp)/symm/mars-tab.c
e5b61a8d
MW
155PRECOMP_PROGS += mars-mktab
156if !CROSS_COMPILING
c9cfa678
MW
157$(precomp)/symm/mars-tab.c:
158 $(AM_V_at)$(MKDIR_P) $(precomp)/symm
ba57d652 159 $(AM_V_at)$(MAKE) mars-mktab$(EXEEXT)
c9cfa678
MW
160 $(AM_V_GEN)./mars-mktab >$(precomp)/symm/mars-tab.c.new && \
161 mv $(precomp)/symm/mars-tab.c.new $(precomp)/symm/mars-tab.c
e5b61a8d 162endif
ba57d652 163mars.t$(EXEEXT): t/mars
0f00dc4c
MW
164EXTRA_DIST += t/mars.aes
165MAINTAINERCLEANFILES += $(srcdir)/t/mars
166t/mars: t/mars.aes
167 $(AM_V_GEN)$(srcdir)/aes-trans Mars \
168 <$(srcdir)/t/mars.aes \
169 >$(srcdir)/t/mars.new && \
170 mv $(srcdir)/t/mars.new $(srcdir)/t/mars
171
172## Daemen, Peeters, Van Assche and Rijmen's `Noekeon'.
173BLKCS += noekeon
174
175## Rivest's `RC2' block cipher.
176BLKCS += rc2
e5b61a8d 177libsymm_la_SOURCES += rc2-tab.c
0f00dc4c
MW
178
179## Rivest's `RC5'.
180BLKCS += rc5
181
182## Daemen and Rijmen's `Rijndael' block cipher, selected as AES.
183BLKCS += rijndael rijndael192 rijndael256
184libsymm_la_SOURCES += rijndael-base.h rijndael-base.c
226639f3 185if CPUFAM_X86
0f23f75f
MW
186libsymm_la_SOURCES += rijndael-x86ish-aesni.S
187endif
188if CPUFAM_AMD64
189libsymm_la_SOURCES += rijndael-x86ish-aesni.S
226639f3 190endif
c9cfa678
MW
191nodist_libsymm_la_SOURCES += ../precomp/symm/rijndael-tab.c
192PRECOMPS += $(precomp)/symm/rijndael-tab.c
e5b61a8d
MW
193PRECOMP_PROGS += rijndael-mktab
194if !CROSS_COMPILING
c9cfa678
MW
195$(precomp)/symm/rijndael-tab.c:
196 $(AM_V_at)$(MKDIR_P) $(precomp)/symm
ba57d652 197 $(AM_V_at)$(MAKE) rijndael-mktab$(EXEEXT)
c9cfa678
MW
198 $(AM_V_GEN)./rijndael-mktab >$(precomp)/symm/rijndael-tab.c.new && \
199 mv $(precomp)/symm/rijndael-tab.c.new \
200 $(precomp)/symm/rijndael-tab.c
e5b61a8d 201endif
ba57d652 202rijndael.t$(EXEEXT): t/rijndael
0f00dc4c
MW
203EXTRA_DIST += t/rijndael.aes
204MAINTAINERCLEANFILES += $(srcdir)/t/rijndael
205t/rijndael: t/rijndael.aes
206 $(AM_V_GEN)$(srcdir)/aes-trans Rijndael \
207 <$(srcdir)/t/rijndael.aes \
208 >$(srcdir)/t/rijndael.new && \
209 mv $(srcdir)/t/rijndael.new $(srcdir)/t/rijndael
210
211## Massey's `SAFER' block ciphers.
212BLKCS += safer safersk
c9cfa678
MW
213nodist_libsymm_la_SOURCES += ../precomp/symm/safer-tab.c
214PRECOMPS += $(precomp)/symm/safer-tab.c
e5b61a8d 215PRECOMP_PROGS += safer-mktab
24497005 216STUBS_HDR += SAFER-SK,safersk,safer
e5b61a8d 217if !CROSS_COMPILING
c9cfa678
MW
218$(precomp)/symm/safer-tab.c:
219 $(AM_V_at)$(MKDIR_P) $(precomp)/symm
ba57d652 220 $(AM_V_at)$(MAKE) safer-mktab$(EXEEXT)
c9cfa678
MW
221 $(AM_V_GEN)./safer-mktab >$(precomp)/symm/safer-tab.c.new && \
222 mv $(precomp)/symm/safer-tab.c.new \
223 $(precomp)/symm/safer-tab.c
e5b61a8d 224endif
0f00dc4c
MW
225
226## Anderson, Biham and Knudsen's `Serpent' block cipher.
227BLKCS += serpent
228libsymm_la_SOURCES += serpent-sbox.h
e5b61a8d 229check_PROGRAMS += serpent-check
0f00dc4c 230TESTS += serpent-check
ba57d652 231serpent.t$(EXEEXT): t/serpent
0f00dc4c
MW
232EXTRA_DIST += t/serpent.aes
233MAINTAINERCLEANFILES += $(srcdir)/t/serpent
234t/serpent: t/serpent.aes
235 $(AM_V_GEN)$(srcdir)/aes-trans Serpent -v rev=1 \
236 <$(srcdir)/t/serpent.aes \
237 >$(srcdir)/t/serpent.new && \
238 mv $(srcdir)/t/serpent.new $(srcdir)/t/serpent
239
240## The National Security Agency's `Skipjack' block cipher. You don't want to
241## use this.
242BLKCS += skipjack
e5b61a8d 243libsymm_la_SOURCES += skipjack-tab.c
0f00dc4c
MW
244
245## Daemen and Rijmen's `Square' block cipher.
246BLKCS += square
c9cfa678
MW
247nodist_libsymm_la_SOURCES += ../precomp/symm/square-tab.c
248PRECOMPS += $(precomp)/symm/square-tab.c
e5b61a8d
MW
249PRECOMP_PROGS += square-mktab
250if !CROSS_COMPILING
c9cfa678
MW
251$(precomp)/symm/square-tab.c:
252 $(AM_V_at)$(MKDIR_P) $(precomp)/symm
ba57d652 253 $(AM_V_at)$(MAKE) square-mktab$(EXEEXT)
c9cfa678
MW
254 $(AM_V_GEN)./square-mktab >$(precomp)/symm/square-tab.c.new && \
255 mv $(precomp)/symm/square-tab.c.new \
256 $(precomp)/symm/square-tab.c
e5b61a8d 257endif
0f00dc4c
MW
258
259## Wheeler and Needham's `TEA' and `XTEA' block ciphers.
260BLKCS += tea xtea
261
262## Schneier, Kelsey, Whiting, Wagner, Hall and Ferguson's `Twofish' block
263## cipher.
264BLKCS += twofish
c9cfa678
MW
265nodist_libsymm_la_SOURCES += ../precomp/symm/twofish-tab.c
266PRECOMPS += $(precomp)/symm/twofish-tab.c
e5b61a8d
MW
267PRECOMP_PROGS += twofish-mktab
268if !CROSS_COMPILING
c9cfa678
MW
269$(precomp)/symm/twofish-tab.c:
270 $(AM_V_at)$(MKDIR_P) $(precomp)/symm
ba57d652 271 $(AM_V_at)$(MAKE) twofish-mktab$(EXEEXT)
c9cfa678
MW
272 $(AM_V_GEN)./twofish-mktab >$(precomp)/symm/twofish-tab.c.new && \
273 mv $(precomp)/symm/twofish-tab.c.new \
274 $(precomp)/symm/twofish-tab.c
e5b61a8d 275endif
ba57d652 276twofish.t$(EXEEXT): t/twofish
0f00dc4c
MW
277EXTRA_DIST += t/twofish.aes
278MAINTAINERCLEANFILES += $(srcdir)/t/twofish
279t/twofish: t/twofish.aes
280 $(AM_V_GEN)$(srcdir)/aes-trans Twofish \
281 <$(srcdir)/t/twofish.aes \
282 >$(srcdir)/t/twofish.new && \
283 mv $(srcdir)/t/twofish.new $(srcdir)/t/twofish
284
285## The old NIST modes for DES.
286BLKCCIPHERMODES += cbc cfb ecb ofb
287
288## Counter mode.
289BLKCCIPHERMODES += counter
290
291###--------------------------------------------------------------------------
292### Hash functions.
293
294HASHES =
295HASHMODES =
296
297HASHCIPHERMODES =
298HASHMODES += $(HASHCIPHERMODES)
299
300HASHMACMODES =
301HASHMODES += $(HASHMACMODES)
302
303## Common definitions for hash functions.
304pkginclude_HEADERS += hash.h
305
306## Source code and headers for the hash functions.
307libsymm_la_SOURCES += $(HASH_C)
308pkginclude_HEADERS += $(HASH_H)
309
310## Lim and KISA's `HAS-160', recommended for use with KCDSA.
311HASHES += has160
312
313## Rivest's `MD' series of hash functions
314HASHES += md2 md4 md5
e5b61a8d 315libsymm_la_SOURCES += md2-tab.c
0f00dc4c
MW
316
317## Dobbertin, Bosselaers and Preneel's `RIPEMD' suite.
318HASHES += rmd128 rmd160 rmd256 rmd320
319
320## The National Security Agency's `SHA-1' hash function.
321HASHES += sha
322
323## The National Security Agency's `SHA-2' suite.
324HASHES += sha224 sha256
325HASHES += sha384 sha512
24497005
MW
326STUBS_HDR += SHA-224,sha224,sha256
327STUBS_HDR += SHA-384,sha384,sha512
0f00dc4c
MW
328
329## Anderson and Biham's `Tiger' hash function.
330HASHES += tiger
c9cfa678
MW
331libsymm_la_SOURCES += tiger-base.h
332nodist_libsymm_la_SOURCES += ../precomp/symm/tiger-tab.c
333PRECOMPS += $(precomp)/symm/tiger-tab.c
e5b61a8d
MW
334PRECOMP_PROGS += tiger-mktab
335if !CROSS_COMPILING
c9cfa678
MW
336$(precomp)/symm/tiger-tab.c:
337 $(AM_V_at)$(MKDIR_P) $(precomp)/symm
ba57d652 338 $(AM_V_at)$(MAKE) tiger-mktab$(EXEEXT)
c9cfa678
MW
339 $(AM_V_GEN)./tiger-mktab >$(precomp)/symm/tiger-tab.c.new && \
340 mv $(precomp)/symm/tiger-tab.c.new \
341 $(precomp)/symm/tiger-tab.c
e5b61a8d 342endif
0f00dc4c
MW
343
344## Barreto and Rijmen's `Whirlpool' hash function.
345HASHES += whirlpool whirlpool256
c9cfa678
MW
346nodist_libsymm_la_SOURCES += ../precomp/symm/whirlpool-tab.c
347PRECOMPS += $(precomp)/symm/whirlpool-tab.c
e5b61a8d 348PRECOMP_PROGS += whirlpool-mktab
24497005 349STUBS_HDR += Whirlpool-256,whirlpool256,whirlpool
e5b61a8d 350if !CROSS_COMPILING
c9cfa678
MW
351$(precomp)/symm/whirlpool-tab.c:
352 $(AM_V_at)$(MKDIR_P) $(precomp)/symm
ba57d652 353 $(AM_V_at)$(MAKE) whirlpool-mktab$(EXEEXT)
c9cfa678
MW
354 $(AM_V_GEN)./whirlpool-mktab \
355 >$(precomp)/symm/whirlpool-tab.c.new && \
356 mv $(precomp)/symm/whirlpool-tab.c.new \
357 $(precomp)/symm/whirlpool-tab.c
e5b61a8d 358endif
0f00dc4c
MW
359
360## Bellare, Canetti and Krawczyk's `HMAC' mode for message authentication.
361HASHMACMODES += hmac
362
363## MGF1, used in OAEP and PSS.
364HASHCIPHERMODES += mgf
365
366###--------------------------------------------------------------------------
367### Other symmetric primitives.
368
369## The CRC32 algorithm, which is useful, but has no worthwhile security.
370pkginclude_HEADERS += crc32.h
371libsymm_la_SOURCES += crc32.c
372ALL_HASHES += crc32=gcrc32
373
374## Rivest's `RC4' stream cipher.
375pkginclude_HEADERS += rc4.h
376libsymm_la_SOURCES += rc4.c
ba57d652 377TESTS += rc4.t$(EXEEXT)
0f00dc4c
MW
378EXTRA_DIST += t/rc4
379ALL_CIPHERS += rc4
380
381## Coppersmith and Rogaway's `SEAL' pseudorandom function.
382pkginclude_HEADERS += seal.h
383libsymm_la_SOURCES += seal.c
ba57d652 384TESTS += seal.t$(EXEEXT)
0f00dc4c
MW
385EXTRA_DIST += t/seal
386ALL_CIPHERS += seal
387
194e93f2
MW
388## Bernstein's `Salsa20' stream cipher. Most of the test vectors come from
389## the eSTREAM project, captured by the Internet Archive's Wayback Machine at
390##
391## http://web.archive.org/web/20070814004154/http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20.tar.gz?view=tar
392##
393## and automatically converted into the format we want.
394EXTRA_DIST += salsa20-tvconv
395pkginclude_HEADERS += salsa20.h salsa20-core.h
396libsymm_la_SOURCES += salsa20.c
e10e6494 397if CPUFAM_X86
0f23f75f
MW
398libsymm_la_SOURCES += salsa20-x86ish-sse2.S
399endif
400if CPUFAM_AMD64
401libsymm_la_SOURCES += salsa20-x86ish-sse2.S
e10e6494 402endif
704d59c8
MW
403if CPUFAM_ARMEL
404libsymm_la_SOURCES += salsa20-arm-neon.S
405endif
ba57d652 406TESTS += salsa20.t$(EXEEXT)
194e93f2
MW
407ALL_CIPHERS += salsa20 salsa2012 salsa208
408ALL_CIPHERS += xsalsa20 xsalsa2012 xsalsa208
409STUBS_HDR += Salsa20/12,salsa2012,salsa20
410STUBS_HDR += Salsa20/8,salsa208,salsa20
411STUBS_HDR += XSalsa20,xsalsa20,salsa20
412STUBS_HDR += XSalsa20/12,xsalsa2012,salsa20
413STUBS_HDR += XSalsa20/8,xsalsa208,salsa20
414EXTRA_DIST += t/salsa20
415MAINTAINERCLEANFILES += t/salsa20
ba57d652 416salsa20.t$(EXEEXT): t/salsa20
194e93f2
MW
417SALSA20_ESTREAM_TV = t/salsa20.estream
418SALSA20_ESTREAM_TV += t/salsa2012.estream
419SALSA20_ESTREAM_TV += t/salsa208.estream
420EXTRA_DIST += t/salsa20.local $(SALSA20_ESTREAM_TV)
421t/salsa20: salsa20-tvconv t/salsa20.local $(SALSA20_ESTREAM_TV)
422 $(AM_V_GEN)cd $(srcdir) && \
423 { echo "### GENERATED by salsa20-tvconv" && \
424 cat t/salsa20.local && \
425 ./salsa20-tvconv $(SALSA20_ESTREAM_TV); \
426 } >t/salsa20.new && \
427 mv t/salsa20.new t/salsa20
428
55d81656
MW
429## Bernstein's `ChaCha' stream cipher.
430pkginclude_HEADERS += chacha.h chacha-core.h
431libsymm_la_SOURCES += chacha.c
e10e6494 432if CPUFAM_X86
0f23f75f
MW
433libsymm_la_SOURCES += chacha-x86ish-sse2.S
434endif
435if CPUFAM_AMD64
436libsymm_la_SOURCES += chacha-x86ish-sse2.S
e10e6494 437endif
704d59c8
MW
438if CPUFAM_ARMEL
439libsymm_la_SOURCES += chacha-arm-neon.S
440endif
ba57d652 441TESTS += chacha.t$(EXEEXT)
55d81656
MW
442EXTRA_DIST += t/chacha
443ALL_CIPHERS += chacha20 chacha12 chacha8
444ALL_CIPHERS += xchacha20 xchacha12 xchacha8
445STUBS_HDR += ChaCha20,chacha20,chacha
446STUBS_HDR += ChaCha12,chacha12,chacha
447STUBS_HDR += ChaCha8,chacha8,chacha
448STUBS_HDR += XChaCha20,xchacha20,chacha
449STUBS_HDR += XChaCha12,xchacha12,chacha
450STUBS_HDR += XChaCha8,xchacha8,chacha
451
0f00dc4c
MW
452###--------------------------------------------------------------------------
453### Autogenerated mode implementations.
454
455## The master stamp file, indicating that we generated all of the sources.
0f00dc4c 456EXTRA_DIST += mode.h.in mode.c.in
e5b61a8d
MW
457EXTRA_DIST += modes/gen-stamp
458MAINTAINERCLEANFILES += modes/gen-stamp
77843a37 459modes/gen-stamp: Makefile.am
e5b61a8d 460 $(AM_V_at)$(MKDIR_P) $(srcdir)/modes
0f00dc4c 461 $(AM_V_GEN)$(multigen) -g $(srcdir)/mode.c.in \
e5b61a8d 462 $(srcdir)/modes/@base-@mode.c \
0f00dc4c
MW
463 base="$(BLKCS)" mode="$(BLKCMODES)"
464 $(AM_V_at)$(multigen) -g $(srcdir)/mode.h.in \
e5b61a8d 465 $(srcdir)/modes/@base-@mode.h \
0f00dc4c
MW
466 base="$(BLKCS)" mode="$(BLKCMODES)"
467 $(AM_V_at)$(multigen) -g $(srcdir)/mode.c.in \
e5b61a8d 468 $(srcdir)/modes/@base-@mode.c \
0f00dc4c
MW
469 base="$(HASHES)" mode="$(HASHMODES)"
470 $(AM_V_at)$(multigen) -g $(srcdir)/mode.h.in \
e5b61a8d 471 $(srcdir)/modes/@base-@mode.h \
0f00dc4c 472 base="$(HASHES)" mode="$(HASHMODES)"
e5b61a8d 473 $(AM_V_at)touch $(srcdir)/modes/gen-stamp
0f00dc4c
MW
474
475## The individual mode interfaces and implementations.
476pkginclude_HEADERS += $(MODE_H)
477
478## Generated implementations.
479BUILT_SOURCES += $(GENMODES_C)
e5b61a8d 480MAINTAINERCLEANFILES += $(GENMODES_C)
ef75f314 481libsymm_la_SOURCES += $(GENMODES_C)
0f00dc4c
MW
482$(GENMODES_C): modes/gen-stamp
483
484## Generated interfaces.
485BUILT_SOURCES += $(GENMODES_H)
e5b61a8d 486MAINTAINERCLEANFILES += $(GENMODES_H)
ef75f314 487pkginclude_HEADERS += $(GENMODES_H)
0f00dc4c
MW
488$(GENMODES_H): modes/gen-stamp
489
490###--------------------------------------------------------------------------
24497005
MW
491### Autogenerated stub headers.
492
493## The master stamp file.
494EXTRA_DIST += stub.h.in
495EXTRA_DIST += stubs.gen-stamp
496MAINTAINERCLEANFILES += stubs.gen-stamp
497stubs.gen-stamp: Makefile.am
498 $(AM_V_at)$(MKDIR_P) $(srcdir)/stubs
499 $(AM_V_GEN)$(multigen) -g $(srcdir)/stub.h.in \
500 $(srcdir)/@name.h descr,name,base="$(STUBS_HDR)"
501 $(AM_V_GEN)$(multigen) -g $(srcdir)/stub.c.in \
502 $(srcdir)/@name.c name="$(STUBS_SRC)"
503 $(AM_V_at)touch $(srcdir)/stubs.gen-stamp
504
505## Generated stub headers.
506BUILT_SOURCES += $(STUB_H) $(STUB_C)
507MAINTAINERCLEANFILES += $(STUB_H) $(STUB_C)
508pkginclude_HEADERS += $(STUB_H)
509$(STUB_H) $(STUB_C): stubs.gen-stamp
510
511###--------------------------------------------------------------------------
0f00dc4c
MW
512### Tables of classes for encryption, hashing, and message authentication.
513
514## The skeleton for the class tables.
515EXTRA_DIST += gthingtab.c.in
516
517## Table of cipher classes.
518pkginclude_HEADERS += gcipher.h
519CLEANFILES += gciphertab.c
520nodist_libsymm_la_SOURCES += gciphertab.c
77843a37 521gciphertab.c: gthingtab.c.in Makefile.am
0f00dc4c
MW
522 $(AM_V_GEN)$(multigen) -g $(srcdir)/gthingtab.c.in gciphertab.c \
523 what=gcipher cls=gccipher thing="$(ALL_CIPHERS)"
524
525## Table of hash classes.
526pkginclude_HEADERS += ghash.h ghash-def.h
527CLEANFILES += ghashtab.c
528nodist_libsymm_la_SOURCES += ghashtab.c
77843a37 529ghashtab.c: gthingtab.c.in Makefile.am
0f00dc4c
MW
530 $(AM_V_GEN)$(multigen) -g $(srcdir)/gthingtab.c.in ghashtab.c \
531 what=ghash cls=gchash thing="$(ALL_HASHES)"
532
533## Table of MAC classes.
534pkginclude_HEADERS += gmac.h
535CLEANFILES += gmactab.c
536nodist_libsymm_la_SOURCES += gmactab.c
77843a37 537gmactab.c: gthingtab.c.in Makefile.am
0f00dc4c
MW
538 $(AM_V_GEN)$(multigen) -g $(srcdir)/gthingtab.c.in gmactab.c \
539 what=gmac cls=gcmac thing="$(ALL_MACS)"
540
541###--------------------------------------------------------------------------
542### Testing.
543
544## Run the test programs.
545TESTS += $(SYMM_TESTS)
546EXTRA_DIST += $(SYMM_TEST_FILES)
547
548## A piece of sample text for round-trip testing encryption modes.
549EXTRA_DIST += daftstory.h
550
551## Clean the debris from the `modes' subdirectory.
ba57d652 552CLEANFILES += modes/*.to modes/*.t$(EXEEXT)
0f00dc4c
MW
553
554###----- That's all, folks --------------------------------------------------