Commit | Line | Data |
---|---|---|
7db733d4 MW |
1 | ### -*-makefile-*- |
2 | ### | |
3 | ### Build script for Catacomb | |
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 | ###-------------------------------------------------------------------------- | |
28 | ### Miscellaneous useful definitions. | |
29 | ||
30 | ## Some convenient abbreviations for file suffixes. | |
31 | e = $(EXEEXT) | |
32 | o = $(OBJEXT) | |
33 | t = t$e | |
34 | ||
35 | ## Installation directories. | |
36 | archincludedir = $(pkglibdir)/include | |
37 | ||
38 | ###-------------------------------------------------------------------------- | |
39 | ### Initial values of common variables. | |
40 | ||
41 | SUBDIRS = | |
42 | ||
43 | EXTRA_DIST = | |
44 | CLEANFILES = | |
45 | DISTCLEANFILES = | |
46 | MAINTAINERCLEANFILES = | |
47 | SUFFIXES = | |
48 | TESTS = | |
49 | BUILT_SOURCES = | |
50 | ||
51 | bin_PROGRAMS = | |
52 | noinst_PROGRAMS = | |
53 | lib_LTLIBRARIES = | |
54 | noinst_LTLIBRARIES = | |
55 | pkginclude_HEADERS = | |
56 | nodist_pkginclude_HEADERS = | |
57 | archinclude_HEADERS = | |
58 | nodist_archinclude_HEADERS = | |
59 | dist_man_MANS = | |
60 | ||
61 | ###-------------------------------------------------------------------------- | |
62 | ### Standard configuration substitutions. | |
63 | ||
64 | ## Substitute tags in files. | |
ba6e6b64 MW |
65 | confsubst = $(top_srcdir)/config/confsubst |
66 | EXTRA_DIST += config/confsubst | |
7db733d4 MW |
67 | |
68 | SUBSTITUTIONS = \ | |
69 | prefix=$(prefix) exec_prefix=$(exec_prefix) \ | |
70 | libdir=$(libdir) includedir=$(includedir) \ | |
ba6e6b64 MW |
71 | PACKAGE=$(PACKAGE) VERSION=$(VERSION) \ |
72 | CATACOMB_LIBS="$(CATACOMB_LIBS)" | |
7db733d4 MW |
73 | |
74 | V_SUBST = $(V_SUBST_$(V)) | |
75 | V_SUBST_ = $(V_SUBST_$(AM_DEFAULT_VERBOSITY)) | |
76 | V_SUBST_0 = @echo " SUBST $@"; | |
77 | SUBST = $(V_SUBST)$(confsubst) | |
78 | ||
79 | ###-------------------------------------------------------------------------- | |
80 | ### The main library. | |
81 | ||
82 | lib_LTLIBRARIES += libcatacomb.la | |
ba6e6b64 | 83 | libcatacomb_la_LIBADD = $(CATACOMB_LIBS) $(mLib_LIBS) |
7db733d4 MW |
84 | libcatacomb_la_LDFLAGS = -version-info $(LIBTOOL_VERSION_INFO) |
85 | libcatacomb_la_SOURCES = | |
86 | nodist_libcatacomb_la_SOURCES = | |
87 | ||
88 | ###-------------------------------------------------------------------------- | |
89 | ### Basic utilities. | |
90 | ||
91 | ## The locked-memory arena. | |
92 | pkginclude_HEADERS += arena.h | |
93 | libcatacomb_la_SOURCES += arena.c | |
94 | ||
95 | ## Constant-type operations. | |
96 | pkginclude_HEADERS += ct.h | |
97 | libcatacomb_la_SOURCES += ct.c | |
98 | ||
99 | ## Acceptable key-size descriptions. | |
100 | pkginclude_HEADERS += keysz.h | |
101 | libcatacomb_la_SOURCES += keysz.c keysz-conv.c | |
102 | ||
103 | ## System-level memory locking. | |
104 | pkginclude_HEADERS += lmem.h | |
105 | libcatacomb_la_SOURCES += lmem.c | |
106 | ||
107 | ## Clearing secrets from memory. | |
108 | pkginclude_HEADERS += paranoia.h | |
109 | ||
110 | ###-------------------------------------------------------------------------- | |
111 | ### Main multiprecision integer library. | |
112 | ||
113 | ## This library is unfortunately intertwined with some of the code generation | |
114 | ## programs, so we must be rather careful. The important bits of the maths | |
115 | ## library needed by these programs is separated out into `libmpbase'. There | |
116 | ## is work going on to fix this unpleasant situation by generating the | |
117 | ## relevant files from Python scripts rather than C programs, using | |
118 | ## information gathered by `configure'. | |
119 | noinst_LTLIBRARIES += libmpbase.la | |
120 | libcatacomb_la_LIBADD += libmpbase.la | |
ba6e6b64 | 121 | libmpbase_la_LIBADD = $(mLib_LIBS) |
7db733d4 MW |
122 | libmpbase_la_SOURCES = |
123 | $(libmpbase_la_OBJECTS): mptypes.h | |
124 | ||
125 | ## Additional buffer I/O functions for mathematical objects. | |
126 | pkginclude_HEADERS += buf.h | |
127 | libcatacomb_la_SOURCES += buf.c | |
128 | ||
129 | ## Infrastructure for fast exponentiation. | |
130 | pkginclude_HEADERS += exp.h | |
131 | libcatacomb_la_SOURCES += exp.c | |
132 | ||
133 | ## Main user-visible multiprecision arithmetic. | |
134 | pkginclude_HEADERS += mp.h | |
135 | libmpbase_la_SOURCES += mp-arith.c | |
136 | TESTS += mp-arith.$t | |
137 | libmpbase_la_SOURCES += mp-const.c | |
138 | libcatacomb_la_SOURCES += mp-exp.c mp-exp.h | |
139 | libcatacomb_la_SOURCES += mp-gcd.c | |
140 | TESTS += mp-gcd.$t | |
141 | libmpbase_la_SOURCES += mp-io.c | |
142 | libcatacomb_la_SOURCES += mp-jacobi.c | |
143 | TESTS += mp-jacobi.$t | |
144 | libmpbase_la_SOURCES += mp-mem.c | |
145 | libmpbase_la_SOURCES += mp-misc.c | |
146 | libcatacomb_la_SOURCES += mp-modexp.c | |
147 | TESTS += mp-modexp.$t | |
148 | libcatacomb_la_SOURCES += mp-modsqrt.c | |
149 | TESTS += mp-modsqrt.$t | |
150 | libcatacomb_la_SOURCES += mp-sqrt.c | |
151 | TESTS += mp-sqrt.$t | |
152 | libcatacomb_la_SOURCES += mp-test.c | |
153 | EXTRA_DIST += tests/mp | |
154 | ||
155 | ## Computing Fibonacci numbers. | |
156 | pkginclude_HEADERS += mp-fibonacci.h | |
157 | libcatacomb_la_SOURCES += mp-fibonacci.c | |
158 | TESTS += mp-fibonacci.$t | |
159 | ||
160 | ## Special memory allocation for multiprecision integers. | |
161 | pkginclude_HEADERS += mparena.h | |
162 | libmpbase_la_SOURCES += mparena.c | |
163 | ||
164 | ## Barrett reduction, an efficient method for modular reduction. | |
165 | pkginclude_HEADERS += mpbarrett.h | |
166 | libcatacomb_la_SOURCES += mpbarrett.c | |
167 | TESTS += mpbarrett.$t | |
168 | libcatacomb_la_SOURCES += mpbarrett-exp.c mpbarrett-mexp.c mpbarrett-exp.h | |
169 | TESTS += mpbarrett-exp.$t mpbarrett-mexp.$t | |
170 | EXTRA_DIST += tests/mpbarrett | |
171 | ||
172 | ## Solving congruences using the Chinese Remainder Theorem. | |
173 | pkginclude_HEADERS += mpcrt.h | |
174 | libcatacomb_la_SOURCES += mpcrt.c | |
175 | TESTS += mpcrt.$t | |
176 | EXTRA_DIST += tests/mpcrt | |
177 | ||
178 | ## Conversions between machine-native and multiprecision integers. | |
179 | pkginclude_HEADERS += mpint.h | |
180 | libcatacomb_la_SOURCES += mpint.c | |
181 | TESTS += mpint.$t | |
182 | EXTRA_DIST += tests/mpint | |
183 | ||
184 | ## Table of upper and lower limits of various types of machine integers, as | |
185 | ## multiprecision integers. | |
186 | nodist_archinclude_HEADERS += mplimits.h | |
187 | nodist_libcatacomb_la_SOURCES += mplimits.c | |
188 | CLEANFILES += mplimits.h mplimits.c | |
189 | noinst_PROGRAMS += genlimits | |
190 | genlimits_LDADD = libmpbase.la | |
191 | mplimits.c: genlimits$e | |
192 | $(AM_V_GEN)./genlimits c >mplimits.c.new && \ | |
193 | mv mplimits.c.new mplimits.c | |
194 | mplimits.h: genlimits$e | |
195 | $(AM_V_GEN)./genlimits h >mplimits.h.new && \ | |
196 | mv mplimits.h.new mplimits.h | |
197 | $(genlimits_OBJECTS): mptypes.h | |
198 | mplimits.lo: mplimits.h | |
199 | ||
200 | ## Montgomery reduction, a clever method for modular arithmetic. | |
201 | pkginclude_HEADERS += mpmont.h | |
202 | libcatacomb_la_SOURCES += mpmont.c | |
203 | TESTS += mpmont.$t | |
204 | libcatacomb_la_SOURCES += mpmont-exp.c mpmont-mexp.c mpmont-exp.h | |
205 | TESTS += mpmont-exp.$t mpmont-mexp.$t | |
206 | EXTRA_DIST += tests/mpmont | |
207 | ||
208 | ## Efficient multiplication of many small numbers. | |
209 | pkginclude_HEADERS += mpmul.h | |
210 | libcatacomb_la_SOURCES += mpmul.c | |
211 | TESTS += mpmul.$t | |
212 | ||
213 | ## Generating random numbers. | |
214 | pkginclude_HEADERS += mprand.h | |
215 | libcatacomb_la_SOURCES += mprand.c | |
216 | ||
217 | ## Efficient reduction modulo numbers with conveninent binary | |
218 | ## representations. | |
219 | pkginclude_HEADERS += mpreduce.h | |
220 | libcatacomb_la_SOURCES += mpreduce.c mpreduce-exp.h | |
221 | TESTS += mpreduce.$t | |
222 | EXTRA_DIST += tests/mpreduce | |
223 | ||
224 | ## Iteratiion over the bianry representation of multiprecision integers. | |
225 | pkginclude_HEADERS += mpscan.h | |
226 | libmpbase_la_SOURCES += mpscan.c | |
227 | ||
228 | ## Conversion between multiprecision integers and their textual | |
229 | ## representations. | |
230 | pkginclude_HEADERS += mptext.h | |
231 | libmpbase_la_SOURCES += mptext.c | |
232 | TESTS += mptext.$t | |
233 | libcatacomb_la_SOURCES += mptext-dstr.c | |
234 | libcatacomb_la_SOURCES += mptext-file.c | |
235 | libcatacomb_la_SOURCES += mptext-len.c | |
236 | libmpbase_la_SOURCES += mptext-string.c | |
237 | EXTRA_DIST += tests/mptext | |
238 | ||
239 | ## Basic types used in the representation of multiprecision integers. | |
240 | nodist_archinclude_HEADERS += mptypes.h | |
241 | BUILT_SOURCES += mptypes.h | |
242 | CLEANFILES += mptypes.h | |
243 | noinst_PROGRAMS += mptypes | |
244 | mptypes.h: mptypes$e | |
245 | $(AM_V_GEN)./mptypes >mptypes.h.new && mv mptypes.h.new mptypes.h | |
246 | ||
247 | ## Low-level multiprecision arithmetic. | |
248 | pkginclude_HEADERS += mpx.h bitops.h mpw.h | |
249 | libmpbase_la_SOURCES += mpx.c | |
250 | TESTS += mpx.$t | |
251 | libmpbase_la_SOURCES += karatsuba.h mpx-kmul.c mpx-ksqr.c | |
252 | TESTS += mpx-kmul.$t mpx-ksqr.$t | |
253 | noinst_PROGRAMS += bittest | |
254 | TESTS += bittest | |
255 | EXTRA_DIST += tests/mpx | |
256 | ||
257 | ## A quick-and-dirty parser, used for parsing descriptions of groups, fields, | |
258 | ## etc. | |
259 | pkginclude_HEADERS += rho.h | |
260 | libcatacomb_la_SOURCES += rho.c | |
261 | TESTS += rho.$t | |
262 | ||
263 | ## Pollard's `rho' algorithm for determining discrete logarithms. | |
264 | pkginclude_HEADERS += qdparse.h | |
265 | libcatacomb_la_SOURCES += qdparse.c | |
266 | ||
267 | ###-------------------------------------------------------------------------- | |
268 | ### Prime number checking, searching, and related jobs. | |
269 | ||
270 | ## Generating Lim--Lee groups, i.e., unit groups of finite fields without | |
271 | ## small subgroups (except for the obvious ones). | |
272 | pkginclude_HEADERS += limlee.h | |
273 | libcatacomb_la_SOURCES += limlee.c | |
274 | ||
275 | ## A table of small prime numbers. | |
276 | nodist_pkginclude_HEADERS += primetab.h | |
277 | nodist_libcatacomb_la_SOURCES += primetab.c | |
278 | CLEANFILES += primetab.h primetab.c | |
279 | BUILT_SOURCES += primetab.h primetab.c | |
280 | noinst_PROGRAMS += genprimes | |
ba6e6b64 | 281 | genprimes_LDADD = $(mLib_LIBS) |
7db733d4 MW |
282 | primetab.h: primetab.c |
283 | primetab.c: genprimes$e | |
284 | $(AM_V_GEN)./genprimes -hprimetab.h -cprimetab.c \ | |
285 | -sCATACOMB_PRIMETAB_H \ | |
286 | -n256 -t"unsigned short" -iprimetab | |
287 | ||
288 | ## Filtering candidate prime numbers by checking for small factors | |
289 | ## efficiently. | |
290 | pkginclude_HEADERS += pfilt.h | |
291 | libcatacomb_la_SOURCES += pfilt.c | |
292 | ||
293 | ## Generating prime numbers (and other kinds of numbers which need searching | |
294 | ## for). | |
295 | pkginclude_HEADERS += pgen.h | |
296 | libcatacomb_la_SOURCES += pgen.c | |
297 | libcatacomb_la_SOURCES += pgen-gcd.c | |
298 | libcatacomb_la_SOURCES += pgen-simul.c | |
299 | libcatacomb_la_SOURCES += pgen-stdev.c | |
300 | TESTS += pgen.$t | |
301 | EXTRA_DIST += tests/pgen | |
302 | ||
303 | ## Finding primitive elements in finite fields. | |
304 | pkginclude_HEADERS += prim.h | |
305 | libcatacomb_la_SOURCES += prim.c | |
306 | ||
307 | ## Iterating over all prime numbers from a given starting point. | |
308 | pkginclude_HEADERS += primeiter.h | |
309 | libcatacomb_la_SOURCES += primeiter.c | |
310 | TESTS += primeiter.$t | |
311 | primeiter.lo: wheel.h | |
312 | ||
313 | ## The Miller--Rabin primality test. | |
314 | pkginclude_HEADERS += rabin.h | |
315 | libcatacomb_la_SOURCES += rabin.c | |
316 | ||
317 | ## Finding `strong' primes, using Gordon's algorithm. Once upon a time, | |
318 | ## products of these kinds of numbers were harder to factor. | |
319 | pkginclude_HEADERS += strongprime.h | |
320 | libcatacomb_la_SOURCES += strongprime.c | |
321 | ||
322 | ## A `wheel', used by the prime iteration machinery. | |
323 | nodist_pkginclude_HEADERS += wheel.h | |
324 | nodist_libcatacomb_la_SOURCES += wheel.c | |
325 | CLEANFILES += wheel.h wheel.c | |
326 | noinst_PROGRAMS += genwheel | |
ba6e6b64 | 327 | genwheel_LDADD = $(mLib_LIBS) |
7db733d4 MW |
328 | wheel.h: wheel.c |
329 | wheel.c: genwheel$e | |
330 | $(AM_V_GEN)./genwheel -hwheel.h -cwheel.c \ | |
331 | -sCATACOMB_WHEEL_H \ | |
332 | -n5 -t"unsigned char" -iwheel | |
333 | ||
334 | ###-------------------------------------------------------------------------- | |
335 | ### Binary polynomial arithmetic. | |
336 | ||
337 | ## User-visible binary polynomial arithmetic. | |
338 | pkginclude_HEADERS += gf.h | |
339 | libcatacomb_la_SOURCES += gf-arith.c | |
340 | TESTS += gf-arith.$t | |
341 | libcatacomb_la_SOURCES += gf-exp.c gf-exp.h | |
342 | libcatacomb_la_SOURCES += gf-gcd.c | |
343 | TESTS += gf-gcd.$t | |
344 | EXTRA_DIST += tests/gf | |
345 | ||
346 | ## Low-level binary polynomial arithmetic. | |
347 | pkginclude_HEADERS += gfx.h | |
348 | libcatacomb_la_SOURCES += gfx.c | |
349 | TESTS += gfx.$t | |
350 | libcatacomb_la_SOURCES += gfx-kmul.c | |
351 | TESTS += gfx-kmul.$t | |
352 | libcatacomb_la_SOURCES += gfx-sqr.c | |
353 | gfx-sqr.lo: gfx-sqr-tab.h | |
354 | TESTS += gfx-sqr.$t | |
355 | CLEANFILES += gfx-sqr-tab.h | |
356 | noinst_PROGRAMS += gfx-sqr-mktab | |
357 | gfx-sqr-tab.h: gfx-sqr-mktab$e | |
358 | $(AM_V_GEN)./gfx-sqr-mktab >gfx-sqr-tab.h.in && \ | |
359 | mv gfx-sqr-tab.h.in gfx-sqr-tab.h | |
360 | EXTRA_DIST += tests/gfx | |
361 | ||
362 | ## Conversions between normal and polynomial basis representations for binary | |
363 | ## fields. | |
364 | pkginclude_HEADERS += gfn.h | |
365 | libcatacomb_la_SOURCES += gfn.c | |
366 | TESTS += gfn.$t | |
367 | EXTRA_DIST += tests/gfn | |
368 | ||
369 | ## Efficient reduction modulo sparse polynomials. | |
370 | pkginclude_HEADERS += gfreduce.h | |
371 | libcatacomb_la_SOURCES += gfreduce.c gfreduce-exp.h | |
372 | TESTS += gfreduce.$t | |
373 | EXTRA_DIST += tests/gfreduce | |
374 | ||
375 | ###-------------------------------------------------------------------------- | |
376 | ### Abstractions for various kinds of algebraic objects. | |
377 | ||
378 | ## Abstract cyclic groups. | |
379 | pkginclude_HEADERS += group.h group-guts.h | |
380 | libcatacomb_la_SOURCES += group-dstr.c | |
381 | libcatacomb_la_SOURCES += group-exp.c group-exp.h | |
382 | libcatacomb_la_SOURCES += group-file.c | |
383 | libcatacomb_la_SOURCES += group-parse.c | |
384 | libcatacomb_la_SOURCES += group-stdops.c | |
385 | libcatacomb_la_SOURCES += group-string.c | |
386 | libcatacomb_la_SOURCES += g-bin.c | |
387 | libcatacomb_la_SOURCES += g-prime.c | |
388 | libcatacomb_la_SOURCES += g-ec.c | |
389 | EXTRA_DIST += group-test.c | |
390 | TESTS += group-test.$t | |
391 | EXTRA_DIST += tests/group | |
392 | ||
393 | ## Abstract finite fields. | |
394 | pkginclude_HEADERS += field.h field-guts.h | |
395 | libcatacomb_la_SOURCES += field.c | |
396 | libcatacomb_la_SOURCES += field-exp.c field-exp.h | |
397 | libcatacomb_la_SOURCES += field-parse.c | |
398 | libcatacomb_la_SOURCES += f-binpoly.c | |
399 | libcatacomb_la_SOURCES += f-niceprime.c | |
400 | libcatacomb_la_SOURCES += f-prime.c | |
401 | ||
402 | ## Table of built-in binary fields. | |
403 | pkginclude_HEADERS += bintab.h | |
404 | libcatacomb_la_SOURCES += bintab.c | |
405 | CLEANFILES += bintab.c | |
406 | EXTRA_DIST += bintab.in bin-gentab.awk | |
407 | bintab.c: bintab.in bin-gentab.awk mpdump$e | |
408 | $(AM_V_GEN)awk -f $(srcdir)/bin-gentab.awk \ | |
409 | <$(srcdir)/bintab.in >bintab.c.new && \ | |
410 | mv bintab.c.new bintab.c | |
411 | ||
412 | ## Table of built-in prime fields. | |
413 | pkginclude_HEADERS += ptab.h | |
414 | libcatacomb_la_SOURCES += ptab.c | |
415 | CLEANFILES += ptab.c | |
416 | EXTRA_DIST += ptab.in p-gentab.awk | |
417 | ptab.c: ptab.in p-gentab.awk mpdump$e | |
418 | $(AM_V_GEN)awk -f $(srcdir)/p-gentab.awk \ | |
419 | <$(srcdir)/ptab.in >ptab.c.new && \ | |
420 | mv ptab.c.new ptab.c | |
421 | ||
422 | ## A utility for building multiprecision integer constants. | |
423 | noinst_PROGRAMS += mpdump | |
424 | mpdump_LDADD = libmpbase.la | |
425 | $(mpdump_OBJECTS): mptypes.h | |
426 | ||
427 | ###-------------------------------------------------------------------------- | |
428 | ### Elliptic curve arithmetic. | |
429 | ||
430 | ## Basic elliptic curve arithmetic. | |
431 | pkginclude_HEADERS += ec.h ec-guts.h | |
432 | libcatacomb_la_SOURCES += ec.c | |
433 | libcatacomb_la_SOURCES += ec-exp.c ec-exp.h | |
434 | libcatacomb_la_SOURCES += ec-info.c | |
435 | TESTS += ec-info.$t | |
436 | libcatacomb_la_SOURCES += ec-bin.c | |
437 | TESTS += ec-bin.$t | |
438 | libcatacomb_la_SOURCES += ec-prime.c | |
439 | TESTS += ec-prime.$t | |
440 | EXTRA_DIST += tests/ec | |
441 | ||
442 | ## The standard `raw' encoding (`EC2OSP') of elliptic curve points. | |
443 | pkginclude_HEADERS += ec-raw.h | |
444 | libcatacomb_la_SOURCES += ec-raw.c | |
445 | ||
446 | ## Test infrastructure for elliptic curves. | |
447 | pkginclude_HEADERS += ec-test.h | |
448 | libcatacomb_la_SOURCES += ec-test.c | |
449 | TESTS += ec-test.$t | |
450 | ||
451 | ## A table of built-in elliptic curves. | |
452 | pkginclude_HEADERS += ectab.h | |
453 | libcatacomb_la_SOURCES += ectab.c | |
454 | CLEANFILES += ectab.c | |
455 | EXTRA_DIST += ectab.in ec-gentab.awk | |
456 | ectab.c: ectab.in ec-gentab.awk mpdump$e | |
457 | $(AM_V_GEN)awk -f $(srcdir)/ec-gentab.awk \ | |
458 | <$(srcdir)/ectab.in >ectab.c.new && \ | |
459 | mv ectab.c.new ectab.c | |
460 | ||
461 | ###-------------------------------------------------------------------------- | |
462 | ### Autogenerated lists. | |
463 | ||
464 | ## Fancy template substitutions. | |
465 | multigen = python $(srcdir)/multigen | |
466 | EXTRA_DIST += multigen | |
467 | ||
468 | ## The heart of this is an enormous cross-product of crypto primitives and | |
469 | ## the corresponding modes of operation. Rather than write it out longhand, | |
470 | ## we generate it using `multigen'. Unfortunately, this needs to be done | |
471 | ## at the Automake level, which causes some interesting bootstrapping | |
472 | ## problems. | |
473 | include modes.am | |
474 | ||
475 | EXTRA_DIST += modes.am.in modes.am | |
476 | MAINTAINERCLEANFILES += $(srcdir)/modes.am | |
477 | ||
478 | ## Generate the lists. | |
479 | $(srcdir)/modes.am: modes.am.in | |
480 | $(AM_V_GEN)$(multigen) -g $(srcdir)/modes.am.in $(srcdir)/modes.am \ | |
481 | blkc="$(BLKCS)" \ | |
482 | blkcmode="$(BLKCMODES)" \ | |
483 | blkcciphermode="$(BLKCCIPHERMODES)" \ | |
484 | hash="$(HASHES)" \ | |
485 | hashmode="$(HASHMODES)" \ | |
486 | hashciphermode="$(HASHCIPHERMODES)" \ | |
487 | hashmacmode="$(HASHMACMODES)" | |
488 | ||
489 | ## Initialize lists of known classes. | |
490 | ALL_CIPHERS = $(CIPHER_MODES) | |
491 | ALL_HASHES = $(HASHES) | |
492 | ALL_MACS = $(MAC_MODES) | |
493 | ||
494 | ###-------------------------------------------------------------------------- | |
495 | ### Block ciphers. | |
496 | ||
497 | BLKCS = | |
498 | BLKCMODES = | |
499 | ||
500 | BLKCCIPHERMODES = | |
501 | BLKCMODES += $(BLKCCIPHERMODES) | |
502 | ||
503 | ## A tool for translating the AES-contest test vectors into a form our test | |
504 | ## rigs understand. | |
505 | EXTRA_DIST += tests/aes-trans | |
506 | ||
507 | ## Block cipher utility macros, mainly used in mode implementations. | |
508 | pkginclude_HEADERS += blkc.h | |
509 | ||
510 | ## Source code and headers for the block ciphers. | |
511 | libcatacomb_la_SOURCES += $(BLKC_C) | |
512 | pkginclude_HEADERS += $(BLKC_H) | |
513 | ||
514 | ## Schneier's `Blowfish' block cipher. | |
515 | BLKCS += blowfish | |
516 | blowfish.lo: blowfish-tab.h | |
517 | CLEANFILES += blowfish-tab.h | |
518 | noinst_PROGRAMS += blowfish-mktab | |
cc3ca08f | 519 | blowfish_mktab_CPPFLAGS = $(AM_CPPFLAGS) -DQUIET |
7db733d4 MW |
520 | blowfish-tab.h: blowfish-mktab$e |
521 | $(AM_V_GEN)./blowfish-mktab >blowfish-tab.h.new && \ | |
522 | mv blowfish-tab.h.new blowfish-tab.h | |
523 | ||
524 | ## Adams and Tavares' `CAST' block ciphers. | |
525 | BLKCS += cast128 cast256 | |
526 | libcatacomb_la_SOURCES += cast-s.c cast-sk.c cast-base.h cast-tab.h | |
527 | cast256.$t: tests/cast256 | |
528 | EXTRA_DIST += tests/cast256.aes | |
529 | MAINTAINERCLEANFILES += $(srcdir)/tests/cast256 | |
530 | tests/cast256: tests/cast256.aes | |
531 | $(AM_V_GEN)$(srcdir)/tests/aes-trans CAST256 \ | |
532 | <$(srcdir)/tests/cast256.aes \ | |
533 | >$(srcdir)/tests/cast256.new && \ | |
534 | mv $(srcdir)/tests/cast256.new $(srcdir)/tests/cast256 | |
535 | ||
536 | ## IBM's `DES' block cipher, by Feistel, Coppersmith, and others. | |
537 | BLKCS += des des3 | |
538 | libcatacomb_la_SOURCES += des-base.h des-base.c desx-tab.h | |
539 | des-base.lo: des-tab.h | |
540 | CLEANFILES += des-tab.h | |
541 | noinst_PROGRAMS += des-mktab | |
542 | des-tab.h: des-mktab$e | |
543 | $(AM_V_GEN)./des-mktab >des-tab.h.new && \ | |
544 | mv des-tab.h.new des-tab.h | |
545 | ||
546 | ## Rivest's `DESX' variant, with pre- and post-whitening. | |
547 | BLKCS += desx | |
548 | libcatacomb_la_SOURCES += desx-tab.h | |
549 | ||
550 | ## Lai and Massey's IDEA. | |
551 | BLKCS += idea | |
552 | ||
553 | ## IBM's `MARS' block cipher. | |
554 | BLKCS += mars | |
555 | mars.lo: mars-tab.h | |
556 | CLEANFILES += mars-tab.h | |
557 | noinst_PROGRAMS += mars-mktab | |
558 | mars-tab.h: mars-mktab$e | |
559 | $(AM_V_GEN)./mars-mktab >mars-tab.h.new && \ | |
560 | mv mars-tab.h.new mars-tab.h | |
561 | mars.$t: tests/mars | |
562 | EXTRA_DIST += tests/mars.aes | |
563 | MAINTAINERCLEANFILES += $(srcdir)/tests/mars | |
564 | tests/mars: tests/mars.aes | |
565 | $(AM_V_GEN)$(srcdir)/tests/aes-trans Mars \ | |
566 | <$(srcdir)/tests/mars.aes \ | |
567 | >$(srcdir)/tests/mars.new && \ | |
568 | mv $(srcdir)/tests/mars.new $(srcdir)/tests/mars | |
569 | ||
570 | ## Daemen, Peeters, Van Assche and Rijmen's `Noekeon'. | |
571 | BLKCS += noekeon | |
572 | ||
573 | ## Rivest's `RC2' block cipher. | |
574 | BLKCS += rc2 | |
575 | libcatacomb_la_SOURCES += rc2-tab.h | |
576 | ||
577 | ## Rivest's `RC5'. | |
578 | BLKCS += rc5 | |
579 | ||
580 | ## Daemen and Rijmen's `Rijndael' block cipher, selected as AES. | |
581 | BLKCS += rijndael rijndael192 rijndael256 | |
582 | libcatacomb_la_SOURCES += rijndael-base.h rijndael-base.c | |
583 | rijndael-base.lo: rijndael-tab.h | |
584 | CLEANFILES += rijndael-tab.h | |
585 | noinst_PROGRAMS += rijndael-mktab | |
586 | rijndael-tab.h: rijndael-mktab$e | |
587 | $(AM_V_GEN)./rijndael-mktab >rijndael-tab.h.new && \ | |
588 | mv rijndael-tab.h.new rijndael-tab.h | |
589 | rijndael.$t: tests/rijndael | |
590 | EXTRA_DIST += tests/rijndael.aes | |
591 | MAINTAINERCLEANFILES += $(srcdir)/tests/rijndael | |
592 | tests/rijndael: tests/rijndael.aes | |
593 | $(AM_V_GEN)$(srcdir)/tests/aes-trans Rijndael \ | |
594 | <$(srcdir)/tests/rijndael.aes \ | |
595 | >$(srcdir)/tests/rijndael.new && \ | |
596 | mv $(srcdir)/tests/rijndael.new $(srcdir)/tests/rijndael | |
597 | ||
598 | ## Massey's `SAFER' block ciphers. | |
599 | BLKCS += safer safersk | |
600 | safer.lo: safer-tab.h | |
601 | CLEANFILES += safer-tab.h | |
602 | noinst_PROGRAMS += safer-mktab | |
603 | safer-tab.h: safer-mktab$e | |
604 | $(AM_V_GEN)./safer-mktab >safer-tab.h.new && \ | |
605 | mv safer-tab.h.new safer-tab.h | |
606 | ||
607 | ## Anderson, Biham and Knudsen's `Serpent' block cipher. | |
608 | BLKCS += serpent | |
609 | libcatacomb_la_SOURCES += serpent-sbox.h | |
610 | noinst_PROGRAMS += serpent-check | |
611 | TESTS += serpent-check | |
612 | serpent.$t: tests/serpent | |
613 | EXTRA_DIST += tests/serpent.aes | |
614 | MAINTAINERCLEANFILES += $(srcdir)/tests/serpent | |
615 | tests/serpent: tests/serpent.aes | |
616 | $(AM_V_GEN)$(srcdir)/tests/aes-trans Serpent -v rev=1 \ | |
617 | <$(srcdir)/tests/serpent.aes \ | |
618 | >$(srcdir)/tests/serpent.new && \ | |
619 | mv $(srcdir)/tests/serpent.new $(srcdir)/tests/serpent | |
620 | ||
621 | ## The National Security Agency's `Skipjack' block cipher. You don't want to | |
622 | ## use this. | |
623 | BLKCS += skipjack | |
624 | libcatacomb_la_SOURCES += skipjack-tab.h | |
625 | ||
626 | ## Daemen and Rijmen's `Square' block cipher. | |
627 | BLKCS += square | |
628 | square.lo: square-tab.h | |
629 | CLEANFILES += square-tab.h | |
630 | noinst_PROGRAMS += square-mktab | |
631 | square-tab.h: square-mktab$e | |
632 | $(AM_V_GEN)./square-mktab >square-tab.h.new && \ | |
633 | mv square-tab.h.new square-tab.h | |
634 | ||
635 | ## Wheeler and Needham's `TEA' and `XTEA' block ciphers. | |
636 | BLKCS += tea xtea | |
637 | ||
638 | ## Schneier, Kelsey, Whiting, Wagner, Hall and Ferguson's `Twofish' block | |
639 | ## cipher. | |
640 | BLKCS += twofish | |
641 | twofish.lo: twofish-tab.h | |
642 | CLEANFILES += twofish-tab.h | |
643 | noinst_PROGRAMS += twofish-mktab | |
644 | twofish-tab.h: twofish-mktab$e | |
645 | $(AM_V_GEN)./twofish-mktab >twofish-tab.h.new && \ | |
646 | mv twofish-tab.h.new twofish-tab.h | |
647 | twofish.$t: tests/twofish | |
648 | EXTRA_DIST += tests/twofish.aes | |
649 | MAINTAINERCLEANFILES += $(srcdir)/tests/twofish | |
650 | tests/twofish: tests/twofish.aes | |
651 | $(AM_V_GEN)$(srcdir)/tests/aes-trans Twofish \ | |
652 | <$(srcdir)/tests/twofish.aes \ | |
653 | >$(srcdir)/tests/twofish.new && \ | |
654 | mv $(srcdir)/tests/twofish.new $(srcdir)/tests/twofish | |
655 | ||
656 | ## The old NIST modes for DES. | |
657 | BLKCCIPHERMODES += cbc cfb ecb ofb | |
658 | ||
659 | ## Counter mode. | |
660 | BLKCCIPHERMODES += counter | |
661 | ||
662 | ###-------------------------------------------------------------------------- | |
663 | ### Hash functions. | |
664 | ||
665 | HASHES = | |
666 | HASHMODES = | |
667 | ||
668 | HASHCIPHERMODES = | |
669 | HASHMODES += $(HASHCIPHERMODES) | |
670 | ||
671 | HASHMACMODES = | |
672 | HASHMODES += $(HASHMACMODES) | |
673 | ||
674 | ## Common definitions for hash functions. | |
675 | pkginclude_HEADERS += hash.h | |
676 | ||
677 | ## Source code and headers for the hash functions. | |
678 | libcatacomb_la_SOURCES += $(HASH_C) | |
679 | pkginclude_HEADERS += $(HASH_H) | |
680 | ||
681 | ## Lim and KISA's `HAS-160', recommended for use with KCDSA. | |
682 | HASHES += has160 | |
683 | ||
684 | ## Rivest's `MD' series of hash functions | |
685 | HASHES += md2 md4 md5 | |
686 | libcatacomb_la_SOURCES += md2-tab.h | |
687 | ||
688 | ## Dobbertin, Bosselaers and Preneel's `RIPEMD' suite. | |
689 | HASHES += rmd128 rmd160 rmd256 rmd320 | |
690 | ||
691 | ## The National Security Agency's `SHA-1' hash function. | |
692 | HASHES += sha | |
693 | ||
694 | ## The National Security Agency's `SHA-2' suite. | |
695 | HASHES += sha224 sha256 | |
696 | HASHES += sha384 sha512 | |
697 | ||
698 | ## Anderson and Biham's `Tiger' hash function. | |
699 | HASHES += tiger | |
700 | libcatacomb_la_SOURCES += tiger-base.h | |
701 | tiger.lo: tiger-tab.h | |
702 | CLEANFILES += tiger-tab.h | |
703 | noinst_PROGRAMS += tiger-mktab | |
704 | tiger-tab.h: tiger-mktab$e | |
705 | $(AM_V_GEN)./tiger-mktab >tiger-tab.h.new && \ | |
706 | mv tiger-tab.h.new tiger-tab.h | |
707 | ||
708 | ## Barreto and Rijmen's `Whirlpool' hash function. | |
709 | HASHES += whirlpool whirlpool256 | |
710 | whirlpool.lo: whirlpool-tab.h | |
711 | CLEANFILES += whirlpool-tab.h | |
712 | noinst_PROGRAMS += whirlpool-mktab | |
713 | whirlpool-tab.h: whirlpool-mktab$e | |
714 | $(AM_V_GEN)./whirlpool-mktab >whirlpool-tab.h.new && \ | |
715 | mv whirlpool-tab.h.new whirlpool-tab.h | |
716 | ||
717 | ## Bellare, Canetti and Krawczyk's `HMAC' mode for message authentication. | |
718 | HASHMACMODES += hmac | |
719 | ||
720 | ## MGF1, used in OAEP and PSS. | |
721 | HASHCIPHERMODES += mgf | |
722 | ||
723 | ###-------------------------------------------------------------------------- | |
724 | ### Other symmetric primitives. | |
725 | ||
726 | ## The CRC32 algorithm, which is useful, but has no worthwhile security. | |
727 | pkginclude_HEADERS += crc32.h | |
728 | libcatacomb_la_SOURCES += crc32.c | |
729 | ALL_HASHES += crc32=gcrc32 | |
730 | ||
731 | ## Rivest's `RC4' stream cipher. | |
732 | pkginclude_HEADERS += rc4.h | |
733 | libcatacomb_la_SOURCES += rc4.c | |
734 | TESTS += rc4.$t | |
735 | EXTRA_DIST += tests/rc4 | |
736 | ALL_CIPHERS += rc4 | |
737 | ||
738 | ## Coppersmith and Rogaway's `SEAL' pseudorandom function. | |
739 | pkginclude_HEADERS += seal.h | |
740 | libcatacomb_la_SOURCES += seal.c | |
741 | TESTS += seal.$t | |
742 | EXTRA_DIST += tests/seal | |
743 | ALL_CIPHERS += seal | |
744 | ###-------------------------------------------------------------------------- | |
745 | ### Autogenerated mode implementations. | |
746 | ||
747 | ## The master stamp file, indicating that we generated all of the sources. | |
748 | CLEANFILES += modes-gen-stamp | |
749 | EXTRA_DIST += mode.h.in mode.c.in | |
750 | modes-gen-stamp: | |
751 | $(AM_V_at)touch modes-gen-stamp | |
752 | $(AM_V_GEN)$(multigen) -g $(srcdir)/mode.c.in \ | |
753 | @base-@mode.c \ | |
754 | base="$(BLKCS)" mode="$(BLKCMODES)" | |
755 | $(AM_V_at)$(multigen) -g $(srcdir)/mode.c.in \ | |
756 | @base-@mode.c \ | |
757 | base="$(HASHES)" mode="$(HASHMODES)" | |
758 | $(AM_V_at)$(multigen) -g $(srcdir)/mode.h.in \ | |
759 | @base-@mode.h \ | |
760 | base="$(BLKCS)" mode="$(BLKCMODES)" | |
761 | $(AM_V_at)$(multigen) -g $(srcdir)/mode.h.in \ | |
762 | @base-@mode.h \ | |
763 | base="$(HASHES)" mode="$(HASHMODES)" | |
764 | $(AM_V_at)touch modes-gen-stamp | |
765 | ||
766 | ## The individual mode interfaces and implementations. | |
767 | pkginclude_HEADERS += $(MODE_H) | |
768 | ||
769 | ## Generated implementations. | |
770 | BUILT_SOURCES += $(GENMODES_C) | |
771 | CLEANFILES += $(GENMODES_C) | |
772 | nodist_libcatacomb_la_SOURCES += $(GENMODES_C) | |
773 | $(GENMODES_C): modes-gen-stamp | |
774 | ||
775 | ## Generated interfaces. | |
776 | BUILT_SOURCES += $(GENMODES_H) | |
777 | CLEANFILES += $(GENMODES_H) | |
778 | nodist_pkginclude_HEADERS += $(GENMODES_H) | |
779 | $(GENMODES_H): modes-gen-stamp | |
780 | ||
781 | ###-------------------------------------------------------------------------- | |
782 | ### Tables of classes for encryption, hashing, and message authentication. | |
783 | ||
784 | ## The skeleton for the class tables. | |
785 | EXTRA_DIST += gthingtab.c.in | |
786 | ||
787 | ## Table of cipher classes. | |
788 | pkginclude_HEADERS += gcipher.h | |
789 | CLEANFILES += gciphertab.c | |
790 | nodist_libcatacomb_la_SOURCES += gciphertab.c | |
791 | gciphertab.c: gthingtab.c.in | |
792 | $(AM_V_GEN)$(multigen) -g $(srcdir)/gthingtab.c.in gciphertab.c \ | |
793 | what=gcipher cls=gccipher thing="$(ALL_CIPHERS)" | |
794 | ||
795 | ## Table of hash classes. | |
796 | pkginclude_HEADERS += ghash.h ghash-def.h | |
797 | CLEANFILES += ghashtab.c | |
798 | nodist_libcatacomb_la_SOURCES += ghashtab.c | |
799 | ghashtab.c: gthingtab.c.in | |
800 | $(AM_V_GEN)$(multigen) -g $(srcdir)/gthingtab.c.in ghashtab.c \ | |
801 | what=ghash cls=gchash thing="$(ALL_HASHES)" | |
802 | ||
803 | ## Table of MAC classes. | |
804 | pkginclude_HEADERS += gmac.h | |
805 | CLEANFILES += gmactab.c | |
806 | nodist_libcatacomb_la_SOURCES += gmactab.c | |
807 | gmactab.c: gthingtab.c.in | |
808 | $(AM_V_GEN)$(multigen) -g $(srcdir)/gthingtab.c.in gmactab.c \ | |
809 | what=gmac cls=gcmac thing="$(ALL_MACS)" | |
810 | ||
811 | ###-------------------------------------------------------------------------- | |
812 | ### Testing for symmetric crypto things. | |
813 | ||
814 | ## Run the test programs. | |
815 | TESTS += $(SYMM_TESTS) | |
816 | EXTRA_DIST += $(SYMM_TEST_FILES) | |
817 | ||
818 | ## A piece of sample text for round-trip testing encryption modes. | |
819 | EXTRA_DIST += daftstory.h | |
820 | ||
821 | ###-------------------------------------------------------------------------- | |
822 | ### Key management. | |
823 | ||
824 | ## Assistance for elliptic-curve keys. | |
825 | pkginclude_HEADERS += ec-keys.h | |
826 | libcatacomb_la_SOURCES += ec-fetch.c | |
827 | ||
828 | ## Managing keys and keyring files. | |
829 | pkginclude_HEADERS += key.h | |
830 | libcatacomb_la_SOURCES += key-attr.c | |
831 | libcatacomb_la_SOURCES += key-fetch.c | |
832 | libcatacomb_la_SOURCES += key-file.c | |
833 | libcatacomb_la_SOURCES += key-io.c | |
834 | libcatacomb_la_SOURCES += key-misc.c | |
835 | libcatacomb_la_SOURCES += key-moan.c | |
836 | ||
837 | ## Managing key data. | |
838 | pkginclude_HEADERS += key-data.h | |
839 | libcatacomb_la_SOURCES += key-binary.c | |
840 | libcatacomb_la_SOURCES += key-data.c | |
841 | libcatacomb_la_SOURCES += key-flags.c | |
842 | libcatacomb_la_SOURCES += key-pack.c | |
843 | libcatacomb_la_SOURCES += key-pass.c | |
844 | libcatacomb_la_SOURCES += key-text.c | |
845 | ||
846 | ## Error reporting. | |
847 | pkginclude_HEADERS += key-error.h | |
848 | libcatacomb_la_SOURCES += key-error.c | |
849 | ||
850 | ## Reading passphrases. | |
851 | pkginclude_HEADERS += passphrase.h | |
852 | libcatacomb_la_SOURCES += passphrase.c | |
853 | ||
854 | ## Interfacing with the passphrase pixie. | |
855 | pkginclude_HEADERS += pixie.h | |
856 | libcatacomb_la_SOURCES += pixie-common.c | |
857 | ||
858 | ###-------------------------------------------------------------------------- | |
859 | ### Secret sharing. | |
860 | ||
861 | ## Efficient sharing over GF(2^8). | |
862 | pkginclude_HEADERS += gfshare.h | |
863 | libcatacomb_la_SOURCES += gfshare.c | |
864 | gfshare.lo: gfshare-tab.h | |
865 | CLEANFILES += gfshare-tab.h | |
866 | noinst_PROGRAMS += gfshare-mktab | |
867 | gfshare-tab.h: gfshare-mktab$e | |
868 | $(AM_V_GEN)./gfshare-mktab >gfshare-tab.h.new && \ | |
869 | mv gfshare-tab.h.new gfshare-tab.h | |
870 | TESTS += gfshare.$t | |
871 | ||
872 | ## Number-theoretic sharing over GF(p). | |
873 | pkginclude_HEADERS += share.h | |
874 | libcatacomb_la_SOURCES += share.c | |
875 | TESTS += share.$t | |
876 | ||
877 | ###-------------------------------------------------------------------------- | |
878 | ### Public-key cryptography. | |
879 | ||
880 | ## The Blum--Blum--Shub random-bit generator. | |
881 | pkginclude_HEADERS += bbs.h | |
882 | libcatacomb_la_SOURCES += bbs-fetch.c | |
883 | libcatacomb_la_SOURCES += bbs-gen.c | |
884 | libcatacomb_la_SOURCES += bbs-jump.c | |
885 | TESTS += bbs-jump.$t | |
886 | libcatacomb_la_SOURCES += bbs-rand.c | |
887 | TESTS += bbs-rand.$t | |
888 | EXTRA_DIST += tests/bbs | |
889 | ||
890 | ## Plain Diffie--Hellman, in Schorr groups. | |
891 | pkginclude_HEADERS += dh.h | |
892 | libcatacomb_la_SOURCES += dh-check.c | |
893 | libcatacomb_la_SOURCES += dh-fetch.c | |
894 | libcatacomb_la_SOURCES += dh-gen.c | |
895 | libcatacomb_la_SOURCES += dh-kcdsa.c | |
896 | libcatacomb_la_SOURCES += dh-limlee.c | |
897 | libcatacomb_la_SOURCES += dh-param.c | |
898 | TESTS += dh-param.$t | |
899 | ||
900 | ## The National Security Agency's Digital Signature Algorithm. | |
901 | pkginclude_HEADERS += dsa.h | |
902 | libcatacomb_la_SOURCES += dsa-gen.c | |
903 | TESTS += dsa-gen.$t | |
904 | libcatacomb_la_SOURCES += dsa-misc.c | |
905 | libcatacomb_la_SOURCES += dsa-sign.c | |
906 | TESTS += dsa-sign.$t | |
907 | libcatacomb_la_SOURCES += dsa-verify.c | |
908 | TESTS += dsa-verify.$t | |
909 | libcatacomb_la_SOURCES += dsa-check.c | |
910 | EXTRA_DIST += tests/dsa | |
911 | ||
912 | ## Generalization of DSA to arbitrary cyclic groups. | |
913 | pkginclude_HEADERS += gdsa.h | |
914 | libcatacomb_la_SOURCES += gdsa.c | |
915 | TESTS += gdsa.$t | |
916 | EXTRA_DIST += tests/gdsa | |
917 | ||
918 | ## KISA `KCDSA', generalized to arbitrary cyclic groups. | |
919 | pkginclude_HEADERS += gkcdsa.h | |
920 | libcatacomb_la_SOURCES += gkcdsa.c | |
921 | TESTS += gkcdsa.$t | |
922 | EXTRA_DIST += tests/gkcdsa | |
923 | ||
924 | ## General key validity checking machinery. | |
925 | pkginclude_HEADERS += keycheck.h | |
926 | libcatacomb_la_SOURCES += keycheck.c | |
927 | libcatacomb_la_SOURCES += keycheck-mp.c | |
928 | libcatacomb_la_SOURCES += keycheck-report.c | |
929 | ||
930 | ## The Rivest--Shamir--Adleman trapdoor one-way function. | |
931 | pkginclude_HEADERS += rsa.h | |
932 | libcatacomb_la_SOURCES += rsa-fetch.c | |
933 | libcatacomb_la_SOURCES += rsa-gen.c | |
934 | libcatacomb_la_SOURCES += rsa-priv.c | |
935 | libcatacomb_la_SOURCES += rsa-pub.c | |
936 | libcatacomb_la_SOURCES += rsa-recover.c | |
937 | libcatacomb_la_SOURCES += oaep.c | |
938 | libcatacomb_la_SOURCES += pkcs1.c | |
939 | libcatacomb_la_SOURCES += pss.c | |
940 | EXTRA_DIST += rsa-test.c | |
941 | TESTS += rsa-test.$t | |
942 | EXTRA_DIST += tests/rsa | |
943 | ||
944 | ###-------------------------------------------------------------------------- | |
945 | ### Random number generators. | |
946 | ||
947 | ## The FIPS186 generator used to generate DSA domain parameters. | |
948 | pkginclude_HEADERS += dsarand.h | |
949 | libcatacomb_la_SOURCES += dsarand.c | |
950 | ||
951 | ## Knuth's lagged-Fibonacci generator. | |
952 | pkginclude_HEADERS += fibrand.h | |
953 | libcatacomb_la_SOURCES += fibrand.c | |
954 | ||
955 | ## The FIPS 140--2 random number generator tests. | |
956 | pkginclude_HEADERS += fipstest.h | |
957 | libcatacomb_la_SOURCES += fipstest.c | |
958 | ||
959 | ## Interface for generic random number sources. | |
960 | pkginclude_HEADERS += grand.h | |
961 | libcatacomb_la_SOURCES += grand.c | |
962 | ||
963 | ## A simple linear-congruential generator. | |
964 | pkginclude_HEADERS += lcrand.h | |
965 | libcatacomb_la_SOURCES += lcrand.c | |
966 | TESTS += lcrand.$t | |
967 | EXTRA_DIST += tests/lcrand | |
968 | ||
969 | ## Maurer's universal statistical test. | |
970 | pkginclude_HEADERS += maurer.h | |
971 | libcatacomb_la_SOURCES += maurer.c | |
972 | ||
973 | ## System-specific noise acquisition. | |
974 | pkginclude_HEADERS += noise.h | |
975 | libcatacomb_la_SOURCES += noise.c | |
976 | ||
977 | ## Cryptographic laundering for true random data generation. | |
978 | pkginclude_HEADERS += rand.h | |
979 | libcatacomb_la_SOURCES += rand.c | |
980 | ||
981 | ## The SSL v3 pseudorandom function. | |
982 | pkginclude_HEADERS += sslprf.h | |
983 | libcatacomb_la_SOURCES += sslprf.c | |
984 | TESTS += sslprf.$t | |
985 | EXTRA_DIST += tests/sslprf | |
986 | ||
987 | ## The TLS v1 pseudorandom function. | |
988 | pkginclude_HEADERS += tlsprf.h | |
989 | libcatacomb_la_SOURCES += tlsprf.c | |
990 | TESTS += tlsprf.$t | |
991 | EXTRA_DIST += tests/tlsprf | |
992 | ||
993 | ###-------------------------------------------------------------------------- | |
994 | ### The `catcrypt' library. | |
995 | ||
996 | noinst_LTLIBRARIES += libcatcrypt.la | |
997 | libcatcrypt_la_SOURCES = | |
998 | ||
999 | ## The main library. | |
1000 | libcatcrypt_la_SOURCES += cc.h | |
1001 | libcatcrypt_la_SOURCES += cc-enc.c | |
1002 | libcatcrypt_la_SOURCES += cc-hash.c | |
1003 | libcatcrypt_la_SOURCES += cc-kem.c | |
1004 | libcatcrypt_la_SOURCES += cc-list.c | |
1005 | libcatcrypt_la_SOURCES += cc-progress.c | |
1006 | libcatcrypt_la_SOURCES += cc-sig.c | |
1007 | libcatcrypt_la_SOURCES += cc-subcmd.c | |
1008 | ||
1009 | ## Date parsing. | |
1010 | libcatcrypt_la_SOURCES += getdate.h | |
1011 | libcatcrypt_la_SOURCES += getdate.y | |
1012 | ||
1013 | ###-------------------------------------------------------------------------- | |
1014 | ### Utility programs. | |
1015 | ||
ba6e6b64 | 1016 | UTILS_LIBS = libcatcrypt.la libcatacomb.la $(mLib_LIBS) $(LIBS) |
7db733d4 MW |
1017 | |
1018 | ## Generate and verify datestamped cookies. | |
1019 | bin_PROGRAMS += cookie | |
1020 | cookie_LDADD = $(UTILS_LIBS) | |
1021 | dist_man_MANS += cookie.1 | |
1022 | ||
1023 | ## Asymmetric message encryption and decryption with deniable authentication. | |
1024 | bin_PROGRAMS += catcrypt | |
1025 | catcrypt_LDADD = $(UTILS_LIBS) | |
1026 | dist_man_MANS += catcrypt.1 | |
1027 | ||
1028 | ## Signing and verifying files. | |
1029 | bin_PROGRAMS += catsign | |
1030 | catsign_LDADD = $(UTILS_LIBS) | |
1031 | dist_man_MANS += catsign.1 | |
1032 | ||
1033 | ## Issue and verify signatures on directory trees. | |
1034 | bin_PROGRAMS += dsig | |
1035 | dsig_LDADD = $(UTILS_LIBS) | |
1036 | dist_man_MANS += dsig.1 | |
1037 | ||
1038 | ## Compute factorials to arbitrary precision. | |
1039 | bin_PROGRAMS += factorial | |
1040 | factorial_LDADD = $(UTILS_LIBS) | |
1041 | ||
1042 | ## Compute Fibonacci numbers to arbitrary precision. | |
1043 | bin_PROGRAMS += fibonacci | |
1044 | fibonacci_LDADD = $(UTILS_LIBS) | |
1045 | ||
1046 | ## Compute hashes of files. | |
1047 | bin_PROGRAMS += hashsum | |
1048 | hashsum_LDADD = $(UTILS_LIBS) | |
1049 | dist_man_MANS += hashsum.1 | |
1050 | ||
1051 | ## Key management utility. | |
1052 | bin_PROGRAMS += key | |
1053 | key_SOURCES = keyutil.c | |
1054 | key_LDADD = $(UTILS_LIBS) | |
1055 | dist_man_MANS += key.1 keyring.5 | |
1056 | ||
1057 | ## Generate passphrases with given entropy using wordlists and Markov models. | |
1058 | bin_PROGRAMS += mkphrase | |
1059 | mkphrase_LDADD = $(UTILS_LIBS) | |
1060 | dist_man_MANS += mkphrase.1 | |
1061 | ||
1062 | ## Performance testing. | |
1063 | bin_PROGRAMS += perftest | |
1064 | perftest_LDADD = $(UTILS_LIBS) | |
1065 | ||
1066 | ## Remember passphrases for limited periods of time. | |
1067 | bin_PROGRAMS += pixie | |
1068 | pixie_SOURCES = pixie.c | |
ba6e6b64 | 1069 | pixie_LDADD = libcatacomb.la $(mLib_LIBS) $(PIXIE_LIBS) |
7db733d4 MW |
1070 | dist_man_MANS += pixie.1 |
1071 | EXTRA_DIST += xpixie | |
1072 | ||
1073 | ## Generate random data. | |
1074 | bin_PROGRAMS += rspit | |
1075 | rspit_LDADD = $(UTILS_LIBS) | |
1076 | ||
1077 | ###-------------------------------------------------------------------------- | |
1078 | ### Testing. | |
1079 | ||
1080 | SUFFIXES += .c .$t .to | |
1081 | .c.to: | |
1082 | $(AM_V_CC)$(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $< -o $@ | |
1083 | .to.$t: libcatacomb.la | |
ba6e6b64 | 1084 | $(AM_V_CCLD)$(LINK) $< libcatacomb.la $(mLib_LIBS) $(LIBS) |
7db733d4 MW |
1085 | .PRECIOUS: %.to |
1086 | CLEANFILES += *.to *.$t | |
1087 | ||
1088 | ###-------------------------------------------------------------------------- | |
1089 | ### The pkg-config file. | |
1090 | ||
1091 | pkgconfigdir = $(libdir)/pkgconfig | |
1092 | pkgconfig_DATA = catacomb.pc | |
1093 | EXTRA_DIST += catacomb.pc.in | |
1094 | CLEANFILES += catacomb.pc | |
1095 | ||
1096 | catacomb.pc: catacomb.pc.in Makefile | |
1097 | $(SUBST) $(srcdir)/catacomb.pc.in >$@.new $(SUBSTITUTIONS) && \ | |
1098 | mv $@.new $@ | |
1099 | ||
1100 | ###-------------------------------------------------------------------------- | |
1101 | ### Release tweaking. | |
1102 | ||
1103 | ## Release number. | |
1104 | dist-hook:: | |
1105 | echo $(VERSION) >$(distdir)/RELEASE | |
1106 | ||
1107 | ## Additional build tools. | |
ba6e6b64 | 1108 | EXTRA_DIST += config/auto-version |
7db733d4 MW |
1109 | |
1110 | ###-------------------------------------------------------------------------- | |
1111 | ### Debian. | |
1112 | ||
1113 | ## General stuff. | |
1114 | EXTRA_DIST += debian/rules | |
1115 | EXTRA_DIST += debian/control | |
1116 | EXTRA_DIST += debian/changelog | |
1117 | EXTRA_DIST += debian/copyright | |
1118 | ||
1119 | ## catacomb-bin | |
1120 | EXTRA_DIST += debian/catacomb-bin.prerm | |
1121 | EXTRA_DIST += debian/catacomb-bin.postinst | |
1122 | EXTRA_DIST += debian/catacomb-bin.config | |
1123 | EXTRA_DIST += debian/catacomb-bin.templates | |
1124 | ||
1125 | ###----- That's all, folks -------------------------------------------------- |