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