New function and example program computes Fibonacci numbers fairly fast.
[u/mdw/catacomb] / Makefile.m4
index 5d5420a..d05e6ee 100644 (file)
@@ -26,8 +26,6 @@
 ## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 ## MA 02111-1307, USA.
 
-AUTOMAKE_OPTIONS = foreign
-
 SUBDIRS = tests
 
 archincludedir = $(libdir)/catacomb/include
@@ -107,7 +105,7 @@ primetab.c: genprimes$(EXEEXT)
 wheel.h: wheel.c
 wheel.c: genwheel$(EXEEXT)
        ./genwheel -h wheel.h -c wheel.c \
-               -s CATACOMB_WHEEL_H -n 5
+               -s CATACOMB_WHEEL_H -n 5 \
                -t "unsigned char" -i wheel
 
 archinclude_HEADERS = mptypes.h mplimits.h
@@ -163,7 +161,8 @@ BUILT_SOURCES = \
 
 lib_LTLIBRARIES = libcatacomb.la
 
-libcatacomb_la_LDFLAGS = -version-info 3:0:1
+libcatacomb_la_LIBADD = $(CATACOMB_LIBS)
+libcatacomb_la_LDFLAGS = -version-info $(LIBTOOL_VERSION_INFO)
 ## Middle number is the patchlevel.  Final number is the minor version.  The
 ## difference between the first and last numbers is major version.
 
@@ -174,7 +173,7 @@ pkginclude_HEADERS = \
        key.h key-error.h key-data.h passphrase.h pixie.h lmem.h \
        mpx.h bitops.h mpw.h mpscan.h mparena.h mp.h mptext.h mpint.h \
        exp.h mpbarrett.h mpmont.h mpreduce.h mp-exp.h \
-       mpcrt.h mprand.h mpmul.h \
+       mpcrt.h mprand.h mpmul.h mp-fibonacci.h \
        gfx.h gf.h gfreduce.h gfn.h gf-exp.h \
        primetab.h wheel.h pfilt.h rabin.h \
        pgen.h primeiter.h prim.h strongprime.h limlee.h keycheck.h \
@@ -201,7 +200,7 @@ define(`MP_SOURCES',
        mp-sqrt.c mp-gcd.c mp-jacobi.c mp-modsqrt.c mp-exp.c mp-modexp.c \
        mpint.c mptext-file.c mptext-dstr.c \
        mptext-len.c \
-       exp.c mpcrt.c mpmul.c mprand.c \
+       exp.c mpcrt.c mpmul.c mprand.c mp-fibonacci.c \
        mpbarrett.c mpbarrett-exp.c mpbarrett-mexp.c mpbarrett-exp.h \
        mpmont.c mpmont-exp.c mpmont-mexp.c mpmont-exp.h \
        mpreduce.c mpreduce-exp.h \
@@ -230,7 +229,7 @@ define(`PGEN_SOURCES',
        rsa-priv.c rsa-pub.c rsa-gen.c rsa-recover.c rsa-fetch.c \
        oaep.c pkcs1.c pss.c \
        dh-gen.c dh-limlee.c dh-kcdsa.c dh-check.c dh-fetch.c dh-param.c \
-       dsarand.c dsa-sign.c dsa-verify.c dsa-gen.c dsa-check.c \
+       dsarand.c dsa-misc.c dsa-sign.c dsa-verify.c dsa-gen.c dsa-check.c \
        gdsa.c gkcdsa.c \
        key-data.c key-flags.c key-text.c key-binary.c key-pass.c \
        key-pack.c key-misc.c key-file.c key-attr.c key-io.c key-moan.c \
@@ -274,10 +273,11 @@ gfx-sqr.lo: gfx-sqr-tab.h
 ## --- Utility programs ---
 
 bin_PROGRAMS = \
-       dsig key pixie cookie rspit factorial hashsum mkphrase \
+       dsig key pixie cookie rspit factorial fibonacci hashsum mkphrase \
        catcrypt catsign
 noinst_LIBRARIES = libcatcrypt.a
-bin_SCRIPTS = catacomb-config xpixie
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = catacomb.pc
 noinst_PROGRAMS = \
        genprimes genwheel mptypes genlimits serpent-check bittest mpdump \
        perftest \
@@ -285,7 +285,8 @@ noinst_PROGRAMS = \
 LDADD = libcatcrypt.a libcatacomb.la
 
 define(`LIBCAT_SRC', `cc.h getdate.h dnl
-       cc-sig.c cc-subcmd.c cc-enc.c cc-kem.c cc-list.c')
+       cc-sig.c cc-subcmd.c cc-enc.c cc-kem.c cc-hash.c \
+       cc-list.c cc-progress.c')
 libcatcrypt_a_SOURCES = LIBCAT_SRC getdate.y
 
 patsubst(MP_BASE MP_SOURCES, `\.c\>', `.lo') dsig.o keyutil.o rspit.o \
@@ -301,11 +302,14 @@ key_SOURCES = keyutil.c
 hashsum_SOURCES = hashsum.c
 rspit_SOURCES = rspit.c
 factorial_SOURCES = factorial.c
+fibonacci_SOURCES = fibonacci.c
 perftest_SOURCES = perftest.c
+perftest_LDADD = $(CATACOMB_LIBS) $(LDADD)
 pixie_SOURCES = pixie.c pixie-common.c lmem.c arena.c passphrase.c
-pixie_LDADD =
+pixie_LDADD = $(PIXIE_LIBS)
 pixie_CFLAGS = $(AM_CFLAGS)
 mkphrase_SOURCES = mkphrase.c
+mkphrase_LDADD = $(CATACOMB_LIBS) $(LDADD)
 bittest_SOURCES = bittest.c
 bittest_LDADD =
 
@@ -361,7 +365,7 @@ man_MANS = \
 
 ## --- Prime group keyring ---
 
-pkgdata_DATA = pgroups.kr
+#pkgdata_DATA = pgroups.kr
 
 $(srcdir)/pgroups.kr: ptab.in mkpgroups
        cd $(srcdir) && rm -f pgroups.kr && ./mkpgroups <ptab.in
@@ -372,7 +376,7 @@ EXTRA_DIST = \
        Makefile.m4 genmodes gengctab $(man_MANS) xpixie \
        group-test.c rsa-test.c \
        ectab.in ec-gentab.awk \
-       ptab.in p-gentab.awk mkpgroups pgroups.kr \
+       ptab.in p-gentab.awk mkpgroups \
        bintab.in bin-gentab.awk \
        README.cipher README.hash README.random README.mp \
        debian/rules debian/copyright debian/control debian/changelog \
@@ -383,6 +387,7 @@ dist-hook:
        @for i in getdate.c gciphertab.c ghashtab.c gmactab.c; do \
          ln $$i $(distdir) || ln $(srcdir)/$$i $(distdir) || true; \
        done
+       echo $(VERSION) >$(distdir)/RELEASE
        @echo datestamp >$(distdir)/modes-stamp || true
        @for i in calc tests; do \
          mkdir $(distdir)/$$i; \
@@ -405,7 +410,7 @@ define(`CTESTRIG',
 $1.to: $1.c
        $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $(srcdir)/$1.c -o $1.to
 $1.t$(EXEEXT): $1.to libcatacomb.la
-       $(CC) $(CFLAGS) $(LDFLAGS) $1.to .libs/libcatacomb.a $(LIBS) -o $1.t$(EXEEXT)')
+       $(CC) $(CFLAGS) $(LDFLAGS) $1.to .libs/libcatacomb.a $(CATACOMB_LIBS) $(LIBS) -o $1.t$(EXEEXT)')
 
 CTESTRIG(rc4)
 CTESTRIG(seal)
@@ -436,6 +441,7 @@ CTESTRIG(mpmont-mexp)
 CTESTRIG(mpreduce)
 CTESTRIG(mpcrt)
 CTESTRIG(mpmul)
+CTESTRIG(mp-fibonacci)
 CTESTRIG(rsa-test)
 CTESTRIG(gfx)
 CTESTRIG(gfx-sqr)
@@ -467,7 +473,8 @@ TESTS = serpent-check bittest testprogs
 
 CLEANFILES = \
        *.t$(EXEEXT) *.to *.kr.old \
-       mptypes.h primetab.c primetab.h wheel.c wheel.h \
+       mptypes.h mplimits.c mplimits.h \
+       primetab.c primetab.h wheel.c wheel.h \
        ectab.c ptab.c bintab.c \
        addsuffix(`gen_tables', `-tab.h')