Add cyclic group abstraction, with test code. Separate off exponentation
[u/mdw/catacomb] / Makefile.m4
1 ## -*-m4-*-
2 ##
3 ## $Id: Makefile.m4,v 1.75 2004/04/01 12:50:09 mdw Exp $
4 ##
5 ## Makefile for Catacomb
6 ##
7 ## (c) 1999 Straylight/Edgeware
8 ##
9
10 ##----- Licensing notice ----------------------------------------------------
11 ##
12 ## This file is part of Catacomb.
13 ##
14 ## Catacomb is free software; you can redistribute it and/or modify
15 ## it under the terms of the GNU Library General Public License as
16 ## published by the Free Software Foundation; either version 2 of the
17 ## License, or (at your option) any later version.
18 ##
19 ## Catacomb is distributed in the hope that it will be useful,
20 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ## GNU Library General Public License for more details.
23 ##
24 ## You should have received a copy of the GNU Library General Public
25 ## License along with Catacomb; if not, write to the Free
26 ## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
27 ## MA 02111-1307, USA.
28
29 ##----- Revision history ----------------------------------------------------
30 ##
31 ## $Log: Makefile.m4,v $
32 ## Revision 1.75 2004/04/01 12:50:09 mdw
33 ## Add cyclic group abstraction, with test code. Separate off exponentation
34 ## functions for better static linking. Fix a buttload of bugs on the way.
35 ## Generally ensure that negative exponents do inversion correctly. Add
36 ## table of standard prime-field subgroups. (Binary field subgroups are
37 ## currently unimplemented but easy to add if anyone ever finds a good one.)
38 ##
39 ## Revision 1.74 2004/03/28 01:58:47 mdw
40 ## Generate, store and retreive elliptic curve keys.
41 ##
42 ## Revision 1.73 2004/03/27 18:38:00 mdw
43 ## Fix distribution.
44 ##
45 ## Revision 1.72 2004/03/27 17:55:11 mdw
46 ## Run ec-info test.
47 ##
48 ## Revision 1.71 2004/03/27 17:54:11 mdw
49 ## Standard curves and curve checking.
50 ##
51 ## Revision 1.70 2004/03/27 00:04:46 mdw
52 ## Implement efficient reduction for pleasant-looking primes.
53 ##
54 ## Revision 1.69 2004/03/23 15:19:32 mdw
55 ## Test elliptic curves more thoroughly.
56 ##
57 ## Revision 1.68 2004/03/21 23:03:30 mdw
58 ## Distribute headers properly.
59 ##
60 ## Revision 1.67 2004/03/21 22:52:06 mdw
61 ## Merge and close elliptic curve branch.
62 ##
63 ## Revision 1.60.2.2 2004/03/21 22:39:46 mdw
64 ## Elliptic curves on binary fields work.
65 ##
66 ## Revision 1.60.2.1 2003/06/10 13:43:53 mdw
67 ## Simple (non-projective) curves over prime fields now seem to work.
68 ##
69 ## Revision 1.66 2004/03/21 22:43:50 mdw
70 ## New hash variant SHA224.
71 ##
72 ## Revision 1.65 2003/11/29 23:39:36 mdw
73 ## Debianization.
74 ##
75 ## Revision 1.64 2003/11/10 22:18:30 mdw
76 ## Build fixes.
77 ##
78 ## Revision 1.63 2003/10/17 16:30:46 mdw
79 ## Report errors if key files don't exist!
80 ##
81 ## Revision 1.62 2003/10/12 15:02:09 mdw
82 ## Reliability fixes.
83 ##
84 ## Revision 1.61 2003/10/11 21:02:33 mdw
85 ## Import buf stuff from tripe.
86 ##
87 ## Revision 1.60 2003/05/16 01:12:37 mdw
88 ## Ship `rc2-tab.h' and `skipjack-tab.h'.
89 ##
90 ## Revision 1.59 2003/05/16 00:54:50 mdw
91 ## Install pixie to fake root if wanted. Ship `desx-tab.h'
92 ##
93 ## Revision 1.58 2002/10/19 17:56:50 mdw
94 ## Fix bit operations. Test them (a bit) better.
95 ##
96 ## Revision 1.57 2002/10/15 22:58:29 mdw
97 ## Fast estimation of number representation lengths.
98 ##
99 ## Revision 1.56 2001/06/16 13:01:10 mdw
100 ## New source files and tests.
101 ##
102 ## Revision 1.55 2001/05/08 22:17:41 mdw
103 ## New cipher Noekeon added.
104 ##
105 ## Revision 1.54 2001/05/07 17:32:52 mdw
106 ## New Rijndael block sizes.
107 ##
108 ## Revision 1.53 2001/04/29 18:11:19 mdw
109 ## New block cipher MARS.
110 ##
111 ## Revision 1.52 2001/04/29 17:37:35 mdw
112 ## Added SAFER block cipher.
113 ##
114 ## Revision 1.51 2001/04/19 18:26:32 mdw
115 ## Add CRC as another hash function.
116 ##
117 ## Revision 1.50 2001/04/06 22:05:10 mdw
118 ## Add support for SSL pseudo-random function.
119 ##
120 ## Revision 1.49 2001/04/04 20:10:52 mdw
121 ## Add support for the TLS pseudo-random function.
122 ##
123 ## Revision 1.48 2001/04/03 19:36:50 mdw
124 ## New block cipher DESX added.
125 ##
126 ## Revision 1.47 2001/03/03 13:14:13 mdw
127 ## Distribute md2-tab.h
128 ##
129 ## Revision 1.46 2001/02/21 20:03:22 mdw
130 ## Added support for MD2 hash function.
131 ##
132 ## Revision 1.45 2001/02/03 16:09:41 mdw
133 ## New files added.
134 ##
135 ## Revision 1.44 2000/10/15 17:49:00 mdw
136 ## New SHA variants with longer outputs.
137 ##
138 ## Revision 1.43 2000/10/08 16:01:26 mdw
139 ## Add binary poly arithmetic. Tidy table generation stuff. Distribute
140 ## calc prototypes.
141 ##
142 ## Revision 1.42 2000/10/08 12:16:06 mdw
143 ## Remove vestiges of @primorial@.
144 ##
145 ## Revision 1.41 2000/08/15 21:46:20 mdw
146 ## Set up the dependencies on primetab.[ch] and mptypes.h properly.
147 ## There's some m4 hacking, but it's worth it not to have to recompile all
148 ## the cipher modes.
149 ##
150 ## Revision 1.40 2000/08/06 10:50:55 mdw
151 ## (mkphrase): New program for generating random passphrases with measured
152 ## strength.
153 ##
154 ## Revision 1.39 2000/07/29 21:55:32 mdw
155 ## Make sure the pixie is installed setuid-root (workaround for an Automake
156 ## bug). Install new manpages.
157 ##
158 ## Revision 1.38 2000/07/29 10:54:55 mdw
159 ## Further fixing to support building using normal `make' again. ;-) I
160 ## think we're there now.
161 ##
162 ## Revision 1.37 2000/07/29 10:02:36 mdw
163 ## Lots of fixing to support `make -j' building.
164 ##
165 ## Revision 1.36 2000/07/20 20:13:38 mdw
166 ## Added Bellare and Rogaway's PSS encoding for RSA signatures.
167 ##
168 ## Revision 1.35 2000/07/16 20:00:46 mdw
169 ## Bug fixes to distribution.
170 ##
171 ## Revision 1.34 2000/07/15 20:55:32 mdw
172 ## More hashes and ciphers. An extra tool.
173 ##
174 ## Revision 1.33 2000/07/09 21:34:15 mdw
175 ## New hash functions and other stuff.
176 ##
177 ## Revision 1.32 2000/07/01 11:27:32 mdw
178 ## Name changes and new files.
179 ##
180 ## Revision 1.31 2000/06/25 13:02:07 mdw
181 ## Fix cleaning of generated files.
182 ##
183 ## Revision 1.30 2000/06/22 19:10:33 mdw
184 ## Fix Makefile to test mp-sqrt.c.
185 ##
186 ## Revision 1.29 2000/06/22 19:04:19 mdw
187 ## More new functions to be added.
188 ##
189 ## Revision 1.28 2000/06/18 23:31:18 mdw
190 ## Rearrange build order to ensure that `mptypes.h' exists by the time it's
191 ## needed.
192 ##
193 ## Revision 1.27 2000/06/17 13:28:50 mdw
194 ## Minor tidying and fixing.
195 ##
196 ## Revision 1.26 2000/06/17 10:33:43 mdw
197 ## Lots of new ciphers and other files.
198 ##
199 ## Revision 1.25 2000/02/12 18:55:40 mdw
200 ## Make it all compile properly.
201 ##
202 ## Revision 1.24 2000/02/12 18:22:26 mdw
203 ## Missed a file. Whoops.
204 ##
205 ## Revision 1.23 2000/02/12 18:21:01 mdw
206 ## Overhaul of key management (again).
207 ##
208 ## Revision 1.22 1999/12/22 16:04:06 mdw
209 ## Lots of new files.
210 ##
211 ## Revision 1.21 1999/12/13 15:47:58 mdw
212 ## Fix a couple of minor bugs in the distribution set.
213 ##
214 ## Revision 1.19 1999/12/11 10:58:24 mdw
215 ## Fix bug in test rig link flags. Add Karatsuba squaring.
216 ##
217 ## Revision 1.18 1999/12/10 23:30:01 mdw
218 ## Lots of new files.
219 ##
220 ## Revision 1.17 1999/11/25 11:38:31 mdw
221 ## Support for conversions between MPs and C integers.
222 ##
223 ## Revision 1.16 1999/11/22 20:51:33 mdw
224 ## Add yet more source files.
225 ##
226 ## Revision 1.15 1999/11/22 14:08:30 mdw
227 ## Improve dependencies for test programs.
228 ##
229 ## Revision 1.14 1999/11/22 00:17:09 mdw
230 ## Create object files for test programs so that rebuilding doesn't take so
231 ## long.
232 ##
233 ## Revision 1.12 1999/11/20 22:36:26 mdw
234 ## Improve dependencies. Move mpx testing into mpx.c.
235 ##
236 ## Revision 1.11 1999/11/20 22:24:53 mdw
237 ## Add Diffie-Hellman support.
238 ##
239 ## Revision 1.10 1999/11/19 19:28:24 mdw
240 ## Add DSA files and tests.
241 ##
242 ## Revision 1.9 1999/11/17 18:05:35 mdw
243 ## Many new files and test cases for multiprecision arithmetic.
244 ##
245 ## Revision 1.8 1999/11/13 01:56:07 mdw
246 ## Include multiprecision maths stuff.
247 ##
248 ## Revision 1.7 1999/11/11 19:01:02 mdw
249 ## Use `libtool' to generate a shared library.
250 ##
251 ## Revision 1.6 1999/11/11 17:47:34 mdw
252 ## Updates for new configuration system, and `mptypes' generator.
253 ##
254 ## Revision 1.5 1999/11/11 00:59:17 mdw
255 ## Minor reformatting.
256 ##
257 ## Revision 1.4 1999/10/24 10:20:36 mdw
258 ## Modify for standalone distribution. The library's getting far too large
259 ## to be sensibly embedded in other programs.
260 ##
261 ## Revision 1.3 1999/10/24 10:04:26 mdw
262 ## Install headers in the right directory.
263 ##
264 ## Revision 1.2 1999/10/23 12:55:35 mdw
265 ## The `CVS' directory can't be hardlinked. Don't worry about this
266 ## overmuch.
267 ##
268 ## Revision 1.1 1999/09/03 08:41:11 mdw
269 ## Initial import.
270 ##
271
272 AUTOMAKE_OPTIONS = foreign
273
274 SUBDIRS = tests
275
276 archincludedir = $(libdir)/catacomb/include
277
278 ## --- List handling macros ---
279 ##
280 ## List handling is nice, usually. Unfortunately, I based this design on
281 ## TeX list macros rather than anything sensible...
282
283 define(`_', `define(`_item', $1)define(`_item_2', $2)emit`'')
284 define(`adorn', `pushdef(`emit', `$1`'_item`'$3')$2`'popdef(`emit')')
285 define(`join',
286 `pushdef(`emit', `adorn(``_(''_item`$2', `$3', ``)'')`'')$1`'popdef(`emit')')
287 define(`addsuffix', `adorn(`', `$1', `$2')')
288 define(`lit', `adorn(`', `$1', `')')
289 define(`nl', `
290 ')
291
292 define(`allwithsuffix',
293 `addsuffix(`$1', `$3') addsuffix(`$2', `$3') dnl
294 addsuffix(join(`$1', `-', `$2'), `$3')')
295
296 ## --- Autogenerated source files ---
297
298 define(`ciphers', `dnl
299 _(des) _(desx) _(des3) _(mars) dnl
300 _(idea) _(safer) _(safersk) dnl
301 _(blowfish) _(twofish) dnl
302 _(tea) _(xtea) dnl
303 _(rc2) _(rc5) dnl
304 _(skipjack) dnl
305 _(cast128) _(cast256) dnl
306 _(square) _(rijndael) _(rijndael192) _(rijndael256) dnl
307 _(serpent) _(noekeon)')
308 define(`cipher_modes', `_(ecb) _(cbc) _(cfb) _(ofb) _(counter)')
309
310 define(`hashes', `dnl
311 _(md5) _(md4) _(md2) _(tiger) dnl
312 _(sha) _(sha224) _(sha256) _(sha384) _(sha512) dnl
313 _(rmd128) _(rmd160) _(rmd256) _(rmd320)')
314 define(`hash_modes', `_(mgf) _(hmac)')
315
316 MODES = \
317 adorn(`$(srcdir)/', join(`ciphers', `-', `cipher_modes'), `.c') \
318 adorn(`$(srcdir)/', join(`ciphers', `-', `cipher_modes'), `.h') \
319 adorn(`$(srcdir)/', join(`hashes', `-', `hash_modes'), `.c') \
320 adorn(`$(srcdir)/', join(`hashes', `-', `hash_modes'), `.h')
321
322 $(MODES): modes-stamp
323 modes-stamp: genmodes
324 cd $(srcdir); ./genmodes "lit(`ciphers')" "lit(`cipher_modes')"
325 cd $(srcdir); ./genmodes "lit(`hashes')" "lit(`hash_modes')"
326 echo datestamp >modes-stamp
327
328 define(`gen_tables', `dnl
329 _(des) _(blowfish) _(twofish) dnl
330 _(square) _(rijndael) dnl
331 _(safer) _(mars) _(tiger) dnl
332 _(gfshare) _(gfx-sqr)')
333
334 autoheaders: addsuffix(`gen_tables', `-tab.h') primetab.h mptypes.h
335 define(`emit', `
336 _item`'-tab.h: _item`'-mktab
337 ./_item`'-mktab >_item`'-tab.h.new
338 mv _item`'-tab.h.new _item`'-tab.h')dnl
339 gen_tables
340
341 primetab.h: primetab.c
342 primetab.c: genprimes
343 ./genprimes -h primetab.h -c primetab.c \
344 -s CATACOMB_PRIMETAB_H -n 256 \
345 -t "unsigned short" -i primetab
346 archinclude_HEADERS = mptypes.h
347 mptypes.h: mptypes
348 ./mptypes >mptypes.h.new
349 mv mptypes.h.new mptypes.h
350
351 ectab.c: ectab.in ec-gentab.sh mpdump
352 $(srcdir)/ec-gentab.sh <$(srcdir)/ectab.in >ectab.c.new
353 mv ectab.c.new ectab.c
354
355 ptab.c: ptab.in p-gentab.sh mpdump
356 $(srcdir)/p-gentab.sh <$(srcdir)/ptab.in >ptab.c.new
357 mv ptab.c.new ptab.c
358
359 BUILT_SOURCES = \
360 getdate.c modes-stamp \
361 addsuffix(join(`ciphers', `-', `cipher_modes'), `.c') \
362 addsuffix(join(`ciphers', `-', `cipher_modes'), `.h') \
363 addsuffix(join(`hashes', `-', `hash_modes'), `.c') \
364 addsuffix(join(`hashes', `-', `hash_modes'), `.h')
365
366 ## --- Building the main library ---
367
368 lib_LTLIBRARIES = libcatacomb.la
369
370 libcatacomb_la_LDFLAGS = -version-info 3:0:1
371 ## Middle number is the patchlevel. Final number is the minor version. The
372 ## difference between the first and last numbers is major version.
373
374 pkginclude_HEADERS = \
375 arena.h paranoia.h buf.h qdparse.h \
376 blkc.h hash.h gcipher.h ghash.h gmac.h grand.h ghash-def.h \
377 lcrand.h fibrand.h rc4.h seal.h rand.h noise.h fipstest.h maurer.h \
378 key.h key-data.h passphrase.h pixie.h lmem.h \
379 mpx.h bitops.h mpw.h mpscan.h mparena.h mp.h mptext.h mpint.h \
380 exp.h mpbarrett.h mpmont.h mpreduce.h \
381 mpcrt.h mprand.h mpmul.h \
382 gfx.h gf.h gfreduce.h \
383 primetab.h pfilt.h rabin.h \
384 pgen.h prim.h strongprime.h limlee.h keycheck.h \
385 bbs.h rsa.h dh.h dsarand.h dsa.h \
386 oaep.h pkcs1.h pss.h tlsprf.h sslprf.h \
387 gfshare.h share.h \
388 rho.h \
389 field.h ec.h ec-exp.h ec-test.h ectab.h ec-keys.h \
390 ptab.h group.h \
391 allwithsuffix(`ciphers', `cipher_modes', `.h') \
392 allwithsuffix(`hashes', `hash_modes', `.h') \
393 addsuffix(`cipher_modes', `-def.h') \
394 addsuffix(`hash_modes', `-def.h') crc32.h
395
396 define(`MP_SOURCES',
397 `mpx.c mpx-kmul.c mpx-ksqr.c mpscan.c mparena.c \
398 mp-misc.c mp-mem.c mp-const.c mp-io.c mp-arith.c mp-test.c \
399 mp-sqrt.c mp-gcd.c mp-jacobi.c mp-modsqrt.c \
400 mpint.c mptext.c mptext-file.c mptext-string.c mptext-dstr.c \
401 mptext-len.c \
402 exp.c mpcrt.c mpmul.c mprand.c \
403 mpbarrett.c mpbarrett-exp.c mpbarrett-mexp.c mpbarrett-exp.h \
404 mpmont.c mpmont-exp.c mpmont-mexp.c mpmont-exp.h \
405 mpreduce.c mpreduce-exp.h \
406 group-stdops.c group-exp.c group-exp.h g-prime.c group-parse.c \
407 group-string.c group-file.c group-dstr.c \
408 rho.c buf.c ptab.c \
409 GF_SOURCES PGEN_SOURCES EC_SOURCES')
410
411 define(`GF_SOURCES',
412 `gfx.c gfx-kmul.c gfx-sqr.c gf-arith.c gf-gcd.c \
413 gfreduce.c gfreduce-exp.h')
414
415 define(`EC_SOURCES',
416 `field.c field-parse.c f-prime.c f-niceprime.c f-binpoly.c \
417 ec.c ec-exp.c ec-prime.c ec-bin.c ec-test.c ec-info.c ectab.c \
418 ec-fetch.c g-ec.c')
419
420 define(`PGEN_SOURCES',
421 `pfilt.c rabin.c \
422 pgen.c pgen-stdev.c pgen-safe.c pgen-gcd.c prim.c strongprime.c \
423 limlee.c \
424 keycheck.c keycheck-mp.c keycheck-report.c \
425 bbs-rand.c bbs-gen.c bbs-jump.c bbs-fetch.c \
426 rsa-priv.c rsa-pub.c rsa-gen.c rsa-recover.c rsa-fetch.c \
427 dh-gen.c dh-limlee.c dh-check.c dh-fetch.c dh-param.c \
428 dsarand.c dsa-sign.c dsa-verify.c dsa-gen.c dsa-check.c \
429 key-data.c key-flags.c key-text.c key-binary.c key-pass.c \
430 key-pack.c key-misc.c key-file.c key-attr.c key-io.c key-moan.c \
431 key-error.c key-fetch.c \
432 primetab.c share.c')
433
434 libcatacomb_la_SOURCES = \
435 grand.c keysz.c \
436 lcrand.c fibrand.c rc4.c seal.c rand.c noise.c fipstest.c maurer.c \
437 arena.c qdparse.c \
438 passphrase.c pixie-client.c pixie-common.c lmem.c \
439 oaep.c pkcs1.c pss.c tlsprf.c sslprf.c \
440 gfshare.c \
441 MP_SOURCES karatsuba.h \
442 des-base.c des-base.h \
443 desx-tab.h \
444 rc2-tab.h \
445 skipjack-tab.h \
446 cast-s.c cast-sk.c cast-base.h cast-tab.h \
447 rijndael-base.c rijndael-base.h \
448 md2-tab.h \
449 serpent-sbox.h skipjack-tab.h tiger-base.h \
450 daftstory.h \
451 addsuffix(join(`ciphers', `-', `cipher_modes'), `.c') \
452 addsuffix(join(`hashes', `-', `hash_modes'), `.c') \
453 addsuffix(`ciphers', `.c') addsuffix(`hashes', `.c') crc32.c
454
455 des-base.lo: des-tab.h
456 blowfish.lo: blowfish-tab.h
457 twofish.lo: twofish-tab.h
458 square.lo: square-tab.h
459 rijndael-base.lo: rijndael-tab.h
460 safer.lo: safer-tab.h
461 mars.lo: mars-tab.h
462 tiger.lo: tiger-tab.h
463 gfshare.lo: gfshare-tab.h
464 gfx-sqr.lo: gfx-sqr-tab.h
465 patsubst(MP_SOURCES, `\.c\>', `.lo') dsig.o keyutil.o rspit.o: \
466 mptypes.h primetab.h
467
468 ## --- Utility programs ---
469
470 bin_PROGRAMS = dsig key pixie rspit factorial hashsum mkphrase
471 bin_SCRIPTS = catacomb-config xpixie
472 noinst_PROGRAMS = \
473 genprimes mptypes serpent-check bittest mpdump \
474 addsuffix(`gen_tables', `-mktab')
475 LDADD = libcatacomb.la
476
477 dsig_SOURCES = dsig.c getdate.y getdate.h
478 key_SOURCES = keyutil.c getdate.y getdate.h
479 hashsum_SOURCES = hashsum.c
480 rspit_SOURCES = rspit.c
481 factorial_SOURCES = factorial.c
482 pixie_SOURCES = pixie.c pixie-common.c lmem.c arena.c
483 pixie_LDADD =
484 mkphrase_SOURCES = mkphrase.c
485 bittest_SOURCES = bittest.c
486 bittest_LDADD =
487
488 define(`emit', `
489 patsubst(_item, `[^a-zA-Z0-9]', `_')_mktab_SOURCES = _item`'-mktab.c
490 patsubst(_item, `[^a-zA-Z0-9]', `_')_mktab_LDADD =')dnl
491 gen_tables
492
493 serpent_check_SOURCES = serpent-check.c
494 serpent_check_LDADD =
495
496 genprimes_SOURCES = genprimes.c
497 genprimes_LDADD =
498
499 mptypes_SOURCES = mptypes.c
500 mptypes_LDADD =
501
502 mpdump_SOURCES = \
503 mpdump.c \
504 mpx.c mpx-kmul.c mpx-ksqr.c mpscan.c mparena.c \
505 mp-misc.c mp-mem.c mp-const.c mp-arith.c mp-io.c \
506 mptext.c mptext-string.c
507 mpdump_LDADD =
508
509 ## --- Install the pixie setuid-root if we can ---
510 ##
511 ## Bodge around a bug in Automake: it doesn't call `install-exec-hook' from
512 ## `install' if there are subdirectories.
513
514 changequote(<, >)
515 install: install-exec-hook
516 install-exec-hook:
517 @pixie="$(DESTDIR)$(bindir)/`echo pixie|sed $(transform)`"; \
518 if chown root $$pixie && chmod 4755 $$pixie; then \
519 echo "chown root $$pixie"; \
520 echo "chmod 4755 $$pixie"; \
521 else \
522 echo "***"; \
523 echo "*** You should probably install $$pixie setuid-root."; \
524 echo "***"; \
525 fi
526 changequote(`, ')
527
528 ## --- Documentation ---
529
530 man_MANS = key.1 hashsum.1 keyring.5 pixie.1
531
532 ## --- Other handy definitions ---
533
534 EXTRA_DIST = \
535 Makefile.m4 genmodes $(man_MANS) xpixie group-test.c \
536 ectab.in ec-gentab.sh ptab.in p-gentab.sh \
537 README.cipher README.hash README.random README.mp \
538 debian/rules debian/copyright debian/control debian/changelog \
539 debian/catacomb-bin.postinst debian/catacomb-bin.config \
540 debian/catacomb-bin.prerm debian/catacomb-bin.templates
541
542 dist-hook:
543 @ln getdate.c $(distdir) || ln $(srcdir)/getdate.c $(distdir) || true
544 @echo datestamp >$(distdir)/modes-stamp || true
545 @for i in calc tests; do \
546 mkdir $(distdir)/$$i; \
547 ln $(srcdir)/$$i/*[!~] $(distdir)/$$i; \
548 done || true
549 # kr=$$HOME/.catacomb/dsig-keyring; \
550 # if [ -r $$kr ]; then \
551 # cd $(distdir); \
552 # ../key -k $$kr extract -f -secret KEYRING; \
553 # find . -type f -print0 | ../dsig -k $$kr sign -0 -oMANIFEST; \
554 # fi
555
556 ## --- Testing ---
557
558 define(`testprogs', `')
559
560 define(`CTESTRIG',
561 `define(`testprogs', testprogs \
562 $1.t)dnl
563 $1.to: $1.c
564 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $(srcdir)/$1.c -o $1.to
565 $1.t: $1.to libcatacomb.la
566 $(CC) $(CFLAGS) $(LDFLAGS) $1.to .libs/libcatacomb.a $(LIBS) -o $1.t')
567
568 CTESTRIG(rc4)
569 CTESTRIG(seal)
570 adorn(`nl`'CTESTRIG(', `ciphers', `)')
571 adorn(`nl`'CTESTRIG(', `hashes', `)')
572 adorn(`nl`'CTESTRIG(', join(`ciphers', `-', `cipher_modes'), `)')
573 adorn(`nl`'CTESTRIG(', join(`hashes', `-', `hash_modes'), `)')
574 CTESTRIG(lcrand)
575 CTESTRIG(oaep)
576 CTESTRIG(tlsprf)
577 CTESTRIG(sslprf)
578 CTESTRIG(mpx)
579 CTESTRIG(mpx-kmul)
580 CTESTRIG(mpx-ksqr)
581 CTESTRIG(mp-arith)
582 CTESTRIG(mp-modsqrt)
583 CTESTRIG(mp-gcd)
584 CTESTRIG(mp-jacobi)
585 CTESTRIG(mp-sqrt)
586 CTESTRIG(mptext)
587 CTESTRIG(mpint)
588 CTESTRIG(mpbarrett)
589 CTESTRIG(mpbarrett-exp)
590 CTESTRIG(mpbarrett-mexp)
591 CTESTRIG(mpmont)
592 CTESTRIG(mpmont-exp)
593 CTESTRIG(mpmont-mexp)
594 CTESTRIG(mpreduce)
595 CTESTRIG(mpcrt)
596 CTESTRIG(mpmul)
597 CTESTRIG(gfx)
598 CTESTRIG(gfx-sqr)
599 CTESTRIG(gfx-kmul)
600 CTESTRIG(gf-arith)
601 CTESTRIG(gf-gcd)
602 CTESTRIG(gfreduce)
603 CTESTRIG(ec-prime)
604 CTESTRIG(ec-bin)
605 CTESTRIG(ec-test)
606 CTESTRIG(ec-info)
607 CTESTRIG(dh-param)
608 CTESTRIG(group-test)
609 CTESTRIG(pgen)
610 CTESTRIG(dsa-gen)
611 CTESTRIG(dsa-sign)
612 CTESTRIG(dsa-verify)
613 CTESTRIG(bbs-rand)
614 CTESTRIG(bbs-jump)
615 CTESTRIG(gfshare)
616 CTESTRIG(share)
617 CTESTRIG(rho)
618
619 TESTS = serpent-check bittest testprogs
620
621 CLEANFILES = \
622 *.t *.to \
623 mptypes.h primetab.c primetab.h ectab.c \
624 addsuffix(`gen_tables', `-tab.h')
625
626 ## --- Makefile building (haha!) ---
627
628 $(srcdir)/Makefile.am: $(srcdir)/Makefile.m4
629 m4 $(srcdir)/Makefile.m4 >$(srcdir)/Makefile.am.new
630 mv $(srcdir)/Makefile.am.new $(srcdir)/Makefile.am
631
632 DISTCLEANFILES = libtool
633
634 MAINTAINERCLEANFILES = \
635 $(srcdir)/Makefile.am \
636 $(srcdir)/getdate.c getdate.c \
637 $(MODES) modes-stamp $(srcdir)/modes-stamp
638
639 ##----- That's all, folks ---------------------------------------------------