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 |
c9cfa678 MW |
191 | nodist_libsymm_la_SOURCES += ../precomp/symm/rijndael-tab.c |
192 | PRECOMPS += $(precomp)/symm/rijndael-tab.c | |
e5b61a8d MW |
193 | PRECOMP_PROGS += rijndael-mktab |
194 | if !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 | 201 | endif |
ba57d652 | 202 | rijndael.t$(EXEEXT): t/rijndael |
0f00dc4c MW |
203 | EXTRA_DIST += t/rijndael.aes |
204 | MAINTAINERCLEANFILES += $(srcdir)/t/rijndael | |
205 | t/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. | |
212 | BLKCS += safer safersk | |
c9cfa678 MW |
213 | nodist_libsymm_la_SOURCES += ../precomp/symm/safer-tab.c |
214 | PRECOMPS += $(precomp)/symm/safer-tab.c | |
e5b61a8d | 215 | PRECOMP_PROGS += safer-mktab |
24497005 | 216 | STUBS_HDR += SAFER-SK,safersk,safer |
e5b61a8d | 217 | if !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 | 224 | endif |
0f00dc4c MW |
225 | |
226 | ## Anderson, Biham and Knudsen's `Serpent' block cipher. | |
227 | BLKCS += serpent | |
228 | libsymm_la_SOURCES += serpent-sbox.h | |
e5b61a8d | 229 | check_PROGRAMS += serpent-check |
0f00dc4c | 230 | TESTS += serpent-check |
ba57d652 | 231 | serpent.t$(EXEEXT): t/serpent |
0f00dc4c MW |
232 | EXTRA_DIST += t/serpent.aes |
233 | MAINTAINERCLEANFILES += $(srcdir)/t/serpent | |
234 | t/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. | |
242 | BLKCS += skipjack | |
e5b61a8d | 243 | libsymm_la_SOURCES += skipjack-tab.c |
0f00dc4c MW |
244 | |
245 | ## Daemen and Rijmen's `Square' block cipher. | |
246 | BLKCS += square | |
c9cfa678 MW |
247 | nodist_libsymm_la_SOURCES += ../precomp/symm/square-tab.c |
248 | PRECOMPS += $(precomp)/symm/square-tab.c | |
e5b61a8d MW |
249 | PRECOMP_PROGS += square-mktab |
250 | if !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 | 257 | endif |
0f00dc4c MW |
258 | |
259 | ## Wheeler and Needham's `TEA' and `XTEA' block ciphers. | |
260 | BLKCS += tea xtea | |
261 | ||
262 | ## Schneier, Kelsey, Whiting, Wagner, Hall and Ferguson's `Twofish' block | |
263 | ## cipher. | |
264 | BLKCS += twofish | |
c9cfa678 MW |
265 | nodist_libsymm_la_SOURCES += ../precomp/symm/twofish-tab.c |
266 | PRECOMPS += $(precomp)/symm/twofish-tab.c | |
e5b61a8d MW |
267 | PRECOMP_PROGS += twofish-mktab |
268 | if !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 | 275 | endif |
ba57d652 | 276 | twofish.t$(EXEEXT): t/twofish |
0f00dc4c MW |
277 | EXTRA_DIST += t/twofish.aes |
278 | MAINTAINERCLEANFILES += $(srcdir)/t/twofish | |
279 | t/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. | |
286 | BLKCCIPHERMODES += cbc cfb ecb ofb | |
287 | ||
288 | ## Counter mode. | |
289 | BLKCCIPHERMODES += counter | |
290 | ||
291 | ###-------------------------------------------------------------------------- | |
292 | ### Hash functions. | |
293 | ||
294 | HASHES = | |
295 | HASHMODES = | |
296 | ||
297 | HASHCIPHERMODES = | |
298 | HASHMODES += $(HASHCIPHERMODES) | |
299 | ||
300 | HASHMACMODES = | |
301 | HASHMODES += $(HASHMACMODES) | |
302 | ||
303 | ## Common definitions for hash functions. | |
304 | pkginclude_HEADERS += hash.h | |
305 | ||
306 | ## Source code and headers for the hash functions. | |
307 | libsymm_la_SOURCES += $(HASH_C) | |
308 | pkginclude_HEADERS += $(HASH_H) | |
309 | ||
310 | ## Lim and KISA's `HAS-160', recommended for use with KCDSA. | |
311 | HASHES += has160 | |
312 | ||
313 | ## Rivest's `MD' series of hash functions | |
314 | HASHES += md2 md4 md5 | |
e5b61a8d | 315 | libsymm_la_SOURCES += md2-tab.c |
0f00dc4c MW |
316 | |
317 | ## Dobbertin, Bosselaers and Preneel's `RIPEMD' suite. | |
318 | HASHES += rmd128 rmd160 rmd256 rmd320 | |
319 | ||
320 | ## The National Security Agency's `SHA-1' hash function. | |
321 | HASHES += sha | |
322 | ||
323 | ## The National Security Agency's `SHA-2' suite. | |
324 | HASHES += sha224 sha256 | |
325 | HASHES += sha384 sha512 | |
24497005 MW |
326 | STUBS_HDR += SHA-224,sha224,sha256 |
327 | STUBS_HDR += SHA-384,sha384,sha512 | |
0f00dc4c MW |
328 | |
329 | ## Anderson and Biham's `Tiger' hash function. | |
330 | HASHES += tiger | |
c9cfa678 MW |
331 | libsymm_la_SOURCES += tiger-base.h |
332 | nodist_libsymm_la_SOURCES += ../precomp/symm/tiger-tab.c | |
333 | PRECOMPS += $(precomp)/symm/tiger-tab.c | |
e5b61a8d MW |
334 | PRECOMP_PROGS += tiger-mktab |
335 | if !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 | 342 | endif |
0f00dc4c MW |
343 | |
344 | ## Barreto and Rijmen's `Whirlpool' hash function. | |
345 | HASHES += whirlpool whirlpool256 | |
c9cfa678 MW |
346 | nodist_libsymm_la_SOURCES += ../precomp/symm/whirlpool-tab.c |
347 | PRECOMPS += $(precomp)/symm/whirlpool-tab.c | |
e5b61a8d | 348 | PRECOMP_PROGS += whirlpool-mktab |
24497005 | 349 | STUBS_HDR += Whirlpool-256,whirlpool256,whirlpool |
e5b61a8d | 350 | if !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 | 358 | endif |
0f00dc4c MW |
359 | |
360 | ## Bellare, Canetti and Krawczyk's `HMAC' mode for message authentication. | |
361 | HASHMACMODES += hmac | |
362 | ||
363 | ## MGF1, used in OAEP and PSS. | |
364 | HASHCIPHERMODES += mgf | |
365 | ||
366 | ###-------------------------------------------------------------------------- | |
367 | ### Other symmetric primitives. | |
368 | ||
369 | ## The CRC32 algorithm, which is useful, but has no worthwhile security. | |
370 | pkginclude_HEADERS += crc32.h | |
371 | libsymm_la_SOURCES += crc32.c | |
372 | ALL_HASHES += crc32=gcrc32 | |
373 | ||
374 | ## Rivest's `RC4' stream cipher. | |
375 | pkginclude_HEADERS += rc4.h | |
376 | libsymm_la_SOURCES += rc4.c | |
ba57d652 | 377 | TESTS += rc4.t$(EXEEXT) |
0f00dc4c MW |
378 | EXTRA_DIST += t/rc4 |
379 | ALL_CIPHERS += rc4 | |
380 | ||
381 | ## Coppersmith and Rogaway's `SEAL' pseudorandom function. | |
382 | pkginclude_HEADERS += seal.h | |
383 | libsymm_la_SOURCES += seal.c | |
ba57d652 | 384 | TESTS += seal.t$(EXEEXT) |
0f00dc4c MW |
385 | EXTRA_DIST += t/seal |
386 | ALL_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. | |
394 | EXTRA_DIST += salsa20-tvconv | |
395 | pkginclude_HEADERS += salsa20.h salsa20-core.h | |
396 | libsymm_la_SOURCES += salsa20.c | |
e10e6494 | 397 | if CPUFAM_X86 |
0f23f75f MW |
398 | libsymm_la_SOURCES += salsa20-x86ish-sse2.S |
399 | endif | |
400 | if CPUFAM_AMD64 | |
401 | libsymm_la_SOURCES += salsa20-x86ish-sse2.S | |
e10e6494 | 402 | endif |
704d59c8 MW |
403 | if CPUFAM_ARMEL |
404 | libsymm_la_SOURCES += salsa20-arm-neon.S | |
405 | endif | |
ba57d652 | 406 | TESTS += salsa20.t$(EXEEXT) |
194e93f2 MW |
407 | ALL_CIPHERS += salsa20 salsa2012 salsa208 |
408 | ALL_CIPHERS += xsalsa20 xsalsa2012 xsalsa208 | |
409 | STUBS_HDR += Salsa20/12,salsa2012,salsa20 | |
410 | STUBS_HDR += Salsa20/8,salsa208,salsa20 | |
411 | STUBS_HDR += XSalsa20,xsalsa20,salsa20 | |
412 | STUBS_HDR += XSalsa20/12,xsalsa2012,salsa20 | |
413 | STUBS_HDR += XSalsa20/8,xsalsa208,salsa20 | |
414 | EXTRA_DIST += t/salsa20 | |
415 | MAINTAINERCLEANFILES += t/salsa20 | |
ba57d652 | 416 | salsa20.t$(EXEEXT): t/salsa20 |
194e93f2 MW |
417 | SALSA20_ESTREAM_TV = t/salsa20.estream |
418 | SALSA20_ESTREAM_TV += t/salsa2012.estream | |
419 | SALSA20_ESTREAM_TV += t/salsa208.estream | |
420 | EXTRA_DIST += t/salsa20.local $(SALSA20_ESTREAM_TV) | |
421 | t/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. |
430 | pkginclude_HEADERS += chacha.h chacha-core.h | |
431 | libsymm_la_SOURCES += chacha.c | |
e10e6494 | 432 | if CPUFAM_X86 |
0f23f75f MW |
433 | libsymm_la_SOURCES += chacha-x86ish-sse2.S |
434 | endif | |
435 | if CPUFAM_AMD64 | |
436 | libsymm_la_SOURCES += chacha-x86ish-sse2.S | |
e10e6494 | 437 | endif |
704d59c8 MW |
438 | if CPUFAM_ARMEL |
439 | libsymm_la_SOURCES += chacha-arm-neon.S | |
440 | endif | |
ba57d652 | 441 | TESTS += chacha.t$(EXEEXT) |
55d81656 MW |
442 | EXTRA_DIST += t/chacha |
443 | ALL_CIPHERS += chacha20 chacha12 chacha8 | |
444 | ALL_CIPHERS += xchacha20 xchacha12 xchacha8 | |
445 | STUBS_HDR += ChaCha20,chacha20,chacha | |
446 | STUBS_HDR += ChaCha12,chacha12,chacha | |
447 | STUBS_HDR += ChaCha8,chacha8,chacha | |
448 | STUBS_HDR += XChaCha20,xchacha20,chacha | |
449 | STUBS_HDR += XChaCha12,xchacha12,chacha | |
450 | STUBS_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 | 456 | EXTRA_DIST += mode.h.in mode.c.in |
e5b61a8d MW |
457 | EXTRA_DIST += modes/gen-stamp |
458 | MAINTAINERCLEANFILES += modes/gen-stamp | |
77843a37 | 459 | modes/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. | |
476 | pkginclude_HEADERS += $(MODE_H) | |
477 | ||
478 | ## Generated implementations. | |
479 | BUILT_SOURCES += $(GENMODES_C) | |
e5b61a8d | 480 | MAINTAINERCLEANFILES += $(GENMODES_C) |
ef75f314 | 481 | libsymm_la_SOURCES += $(GENMODES_C) |
0f00dc4c MW |
482 | $(GENMODES_C): modes/gen-stamp |
483 | ||
484 | ## Generated interfaces. | |
485 | BUILT_SOURCES += $(GENMODES_H) | |
e5b61a8d | 486 | MAINTAINERCLEANFILES += $(GENMODES_H) |
ef75f314 | 487 | pkginclude_HEADERS += $(GENMODES_H) |
0f00dc4c MW |
488 | $(GENMODES_H): modes/gen-stamp |
489 | ||
24497005 MW |
490 | ###-------------------------------------------------------------------------- |
491 | ### Autogenerated stub headers. | |
492 | ||
493 | ## The master stamp file. | |
494 | EXTRA_DIST += stub.h.in | |
495 | EXTRA_DIST += stubs.gen-stamp | |
496 | MAINTAINERCLEANFILES += stubs.gen-stamp | |
497 | stubs.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. | |
506 | BUILT_SOURCES += $(STUB_H) $(STUB_C) | |
507 | MAINTAINERCLEANFILES += $(STUB_H) $(STUB_C) | |
508 | pkginclude_HEADERS += $(STUB_H) | |
509 | $(STUB_H) $(STUB_C): stubs.gen-stamp | |
510 | ||
0f00dc4c MW |
511 | ###-------------------------------------------------------------------------- |
512 | ### Tables of classes for encryption, hashing, and message authentication. | |
513 | ||
514 | ## The skeleton for the class tables. | |
515 | EXTRA_DIST += gthingtab.c.in | |
516 | ||
517 | ## Table of cipher classes. | |
518 | pkginclude_HEADERS += gcipher.h | |
519 | CLEANFILES += gciphertab.c | |
520 | nodist_libsymm_la_SOURCES += gciphertab.c | |
77843a37 | 521 | gciphertab.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. | |
526 | pkginclude_HEADERS += ghash.h ghash-def.h | |
527 | CLEANFILES += ghashtab.c | |
528 | nodist_libsymm_la_SOURCES += ghashtab.c | |
77843a37 | 529 | ghashtab.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. | |
534 | pkginclude_HEADERS += gmac.h | |
535 | CLEANFILES += gmactab.c | |
536 | nodist_libsymm_la_SOURCES += gmactab.c | |
77843a37 | 537 | gmactab.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. | |
545 | TESTS += $(SYMM_TESTS) | |
546 | EXTRA_DIST += $(SYMM_TEST_FILES) | |
547 | ||
548 | ## A piece of sample text for round-trip testing encryption modes. | |
549 | EXTRA_DIST += daftstory.h | |
550 | ||
551 | ## Clean the debris from the `modes' subdirectory. | |
ba57d652 | 552 | CLEANFILES += modes/*.to modes/*.t$(EXEEXT) |
0f00dc4c MW |
553 | |
554 | ###----- That's all, folks -------------------------------------------------- |