This is an autogenerated patch header for a single-debian-patch file. The
delta against upstream is either kept as a single patch, or maintained
in some VCS, and exported as a single patch instead of more manageable
atomic patches.

--- libmcrypt-2.5.8.orig/Makefile.am
+++ libmcrypt-2.5.8/Makefile.am
@@ -1,9 +1,6 @@
 ## Process this file with automake to produce Makefile.in
-
-INCLUDES = $(INCLTDL)
+ACLOCAL_AMFLAGS = -I m4
+AM_CPPFLAGS = $(INCLTDL)
 EXTRA_DIST = KNOWN-BUGS THANKS NEWS libmcrypt.spec.in libmcrypt.spec COPYING.LIB
-DIST_SUBDIRS = libltdl modules include lib src doc
+DIST_SUBDIRS = $(LIBLTDL_DIR) modules include lib src doc
 SUBDIRS = $(LIBLTDL_DIR) modules include lib src doc
-
-ChangeLog:
-	cvs2cl --utc --fsf -t -S --prune
--- /dev/null
+++ libmcrypt-2.5.8/configure.ac
@@ -0,0 +1,239 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_PREREQ([2.69])
+AC_INIT([libmcrypt],[2.5.8])
+AC_CONFIG_MACRO_DIRS([m4])
+AC_CONFIG_SRCDIR([lib/mcrypt.c])
+
+LIBMCRYPT_MAJOR_VERSION=2
+LIBMCRYPT_MINOR_VERSION=5
+LIBMCRYPT_MICRO_VERSION=8
+LIBMCRYPT_VERSION=$LIBMCRYPT_MAJOR_VERSION.$LIBMCRYPT_MINOR_VERSION.$LIBMCRYPT_MICRO_VERSION
+
+LIBMCRYPT_MOST_RECENT_INTERFACE=8
+LIBMCRYPT_CURRENT_INTERFACE_IMPLEMENTATION_NUMBER=$LIBMCRYPT_MICRO_VERSION
+LIBMCRYPT_OLDEST_INTERFACE=4
+
+AC_CANONICAL_TARGET
+AM_INIT_AUTOMAKE([foreign -Wall])
+AC_CONFIG_HEADERS([config.h])
+
+AC_PROG_MAKE_SET
+
+AC_PROG_CXX
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+AM_PROG_AR
+
+AX_CFLAGS_WARN_ALL
+AX_CHECK_COMPILE_FLAG([-Wextra], [CFLAGS="${CFLAGS} -Wextra"])
+AX_CHECK_COMPILE_FLAG([-pedantic], [CFLAGS="${CFLAGS} -pedantic"])
+
+case "$host_os" in
+        *w32*)
+                LDFLAGS="$LDFLAGS -no-undefined"
+                AC_DEFINE( WIN32, 1, [whether win32 environment])
+        ;;
+        *win32*) 
+                LDFLAGS="$LDFLAGS -no-undefined"
+                AC_DEFINE( WIN32, 1, [whether win32 environment])
+        ;;
+        cygwin*) 
+                LDFLAGS="$LDFLAGS -enable-runtime-pseudo-reloc -no-undefined"
+                AC_DEFINE( WIN32, 1, [whether win32 environment])
+        ;;
+	mingw*)
+                LDFLAGS="$LDFLAGS -enable-runtime-pseudo-reloc -no-undefined"
+	        AC_DEFINE( WIN32, 1, [whether win32 environment])
+	;;	
+esac
+
+dnl Checks for programs.
+AC_PROG_INSTALL
+AC_PROG_LN_S
+
+opt_dmalloc_mode=no
+AC_MSG_CHECKING([whether in dmalloc mode])
+AC_ARG_ENABLE(dmalloc-mode,
+[  --enable-dmalloc-mode enable dmalloc mode],
+opt_dmalloc_mode=$enableval)
+AC_MSG_RESULT($opt_dmalloc_mode)
+
+
+if test x$ac_cv_c_compiler_gnu = xyes; then
+	if test x$opt_dmalloc_mode = xyes; then
+	  AC_CHECK_LIB( dmalloc, main)
+	  AC_DEFINE(USE_DMALLOC, 1, [dmalloc])
+	fi
+fi
+
+opt_enable_ltdl=no
+AC_MSG_CHECKING([whether to enable dynamic module loading])
+AC_ARG_ENABLE(dynamic-loading,
+[  --enable-dynamic-loading   enable dynamic module loading],
+opt_enable_ltdl=$enableval)
+AC_MSG_RESULT($opt_enable_ltdl)
+
+MCRYPT_MODE_MODULES="cbc cfb ctr ecb ncfb nofb ofb stream"
+MCRYPT_ALGORITHM_MODULES="threeway cast-128 gost rijndael-128 safer-sk64 twofish \
+ arcfour cast-256 loki97 rijndael-192 saferplus wake \
+ blowfish-compat des rijndael-256 serpent xtea \
+ blowfish enigma rc2 safer-sk128 tripledes"
+
+
+LT_INIT([dlopen],[win32-dll])
+LT_CONFIG_LTDL_DIR([libltdl])
+LTDL_INIT
+
+if test "x$opt_enable_ltdl" != xno; then
+ touch lib/mcrypt_internal.h
+
+ AC_CHECK_LIB( ltdl, lt_dlmutex_register, AC_DEFINE(DLMUTEX, 1, [dlmutex]))
+
+_LTDL_CONVENIENCE
+ _LT_CONFIG_LTDL_DIR([m4_default([], [libltdl])])
+_LTDL_INSTALLABLE
+ AC_SUBST(INCLTDL)
+ AC_SUBST(LIBLTDL)
+ LIBLTDL_DIR=libltdl
+ AC_SUBST(LIBLTDL_DIR)
+
+ AC_DISABLE_STATIC
+
+ AC_DEFINE(USE_LTDL, 1, [use libltdl])
+
+ if test x$LIBLTDL = x; then
+	:
+ else
+	LTLIBS="-lltdl"
+ fi
+ opt_include_algos=no
+
+# create the names of the .la libraries to install
+ for i in $MCRYPT_ALGORITHM_MODULES
+ do \
+  INSTALL_ALGORITHM_MODULES="$INSTALL_ALGORITHM_MODULES $i.la"
+ done
+
+ for i in $MCRYPT_MODE_MODULES
+ do \
+  INSTALL_MODE_MODULES="$INSTALL_MODE_MODULES $i.la"
+ done
+
+ AC_SUBST(INSTALL_ALGORITHM_MODULES)
+ AC_SUBST(INSTALL_MODE_MODULES)
+
+else
+ for i in $MCRYPT_ALGORITHM_MODULES
+ do \
+  NOINSTALL_ALGORITHM_MODULES="$NOINSTALL_ALGORITHM_MODULES $i.la"
+ done
+
+ for i in $MCRYPT_MODE_MODULES
+ do \
+  NOINSTALL_MODE_MODULES="$NOINSTALL_MODE_MODULES $i.la"
+ done
+
+ AC_SUBST(NOINSTALL_ALGORITHM_MODULES)
+ AC_SUBST(NOINSTALL_MODE_MODULES)
+
+ opt_include_algos="$MCRYPT_MODE_MODULES $MCRYPT_ALGORITHM_MODULES"
+ echo "***"
+ echo "*** Dynamic loading has been disabled"
+fi
+
+AC_MSG_CHECKING([which algorithms to include into library])
+AC_ARG_WITH(included-algos,
+[  --with-included-algos=algo1,algo2,... include algorithms/modes into the library],
+touch lib/mcrypt_internal.h
+opt_include_algos=$withval)
+
+if test "x$opt_include_algos" = xyes; then
+	opt_include_algos=""
+fi
+if test "x$opt_include_algos" = xno; then
+	opt_include_algos=""
+fi
+
+
+EXTRA_OBJECTS=""
+ALG=`echo -n $opt_include_algos|sed "s/,/ /g"|sed "s/\n/ /g"`
+for i in $ALG
+do \
+test -f modules/algorithms/$i.c && EXTRA_OBJECTS="$EXTRA_OBJECTS ../modules/algorithms/$i.lo"
+test -f modules/modes/$i.c && EXTRA_OBJECTS="$EXTRA_OBJECTS ../modules/modes/$i.lo"
+done
+
+AC_MSG_RESULT($opt_include_algos)
+
+
+EXTRA_ALGOS=$ALG
+AC_SUBST(EXTRA_ALGOS)
+AC_SUBST(EXTRA_OBJECTS)
+
+AC_SUBST(LIBMCRYPT_MAJOR_VERSION)
+AC_SUBST(LIBMCRYPT_MINOR_VERSION)
+AC_SUBST(LIBMCRYPT_MICRO_VERSION)
+AC_SUBST(LIBMCRYPT_VERSION)
+
+AC_SUBST(LIBMCRYPT_MOST_RECENT_INTERFACE)
+AC_SUBST(LIBMCRYPT_CURRENT_INTERFACE_IMPLEMENTATION_NUMBER)
+AC_SUBST(LIBMCRYPT_OLDEST_INTERFACE)
+
+LT_CURRENT=$LIBMCRYPT_MOST_RECENT_INTERFACE
+LT_REVISION=$LIBMCRYPT_CURRENT_INTERFACE_IMPLEMENTATION_NUMBER
+LT_AGE=`expr $LIBMCRYPT_MOST_RECENT_INTERFACE - $LIBMCRYPT_OLDEST_INTERFACE`
+AC_SUBST(LT_CURRENT)
+AC_SUBST(LT_REVISION)
+AC_SUBST(LT_AGE)
+AC_INCLUDES_DEFAULT
+AC_HEADER_DIRENT
+AC_C_INLINE
+AC_C_CONST
+
+AC_CHECK_HEADERS([argz.h byteswap.h dirent.h dlfcn.h endian.h malloc.h])
+AC_CHECK_HEADERS([sys/endian.h sys/mman.h])
+AC_CHECK_HEADERS([limits.h])
+
+AC_FUNC_MALLOC
+AC_FUNC_MEMCMP
+AC_FUNC_REALLOC
+
+AC_CHECK_FUNCS([bzero memmove memset mlock readdir_r strchr strdup strrchr])
+AC_CHECK_FUNCS([readdir,,])
+AC_CHECK_FUNCS([bcopy,,])
+
+dnl Checks for libraries.
+AC_C_BIGENDIAN
+AC_CHECK_SIZEOF([unsigned long int], [4])
+AC_CHECK_SIZEOF([unsigned int], [4])
+AC_CHECK_SIZEOF([unsigned short int], [2])
+AC_CHECK_SIZEOF([unsigned char], [1])
+
+AC_SUBST(LIBTOOL_DEPS)
+
+
+LIBMCRYPT_LIBS="$LIBS -L${libdir} -lmcrypt $LTLIBS"
+LIBMCRYPT_CFLAGS="-I${includedir}"
+AC_SUBST(LIBMCRYPT_LIBS)
+AC_SUBST(LIBMCRYPT_CFLAGS)
+
+AC_CONFIG_COMMANDS([default-1],[[
+ chmod +x lib/libmcrypt-config
+]],[[]])
+
+AC_CONFIG_FILES([Makefile
+		 libmcrypt.spec
+		 lib/Makefile
+		 doc/Makefile
+		 src/Makefile
+		 include/mutils/mcrypt.h
+		 include/Makefile
+		 modules/Makefile
+		 modules/modes/Makefile
+		 modules/algorithms/Makefile
+		 lib/libmcrypt-config])
+AC_OUTPUT
+
--- libmcrypt-2.5.8.orig/doc/mcrypt.3
+++ libmcrypt-2.5.8/doc/mcrypt.3
@@ -50,7 +50,7 @@ here is CAST-128 (also called CAST5) whi
 
 .B CAST-256:
 CAST-256 was designed by Carlisle Adams. It is a symmetric cipher designed in
-accordance with the CAST design procedure. It is an extention of
+accordance with the CAST design procedure. It is an extension of
 the CAST-128, having a 128 bit block size, and up to 256 bit key size.
 
 .B xTEA:
--- libmcrypt-2.5.8.orig/include/Makefile.am
+++ libmcrypt-2.5.8/include/Makefile.am
@@ -1,5 +1,2 @@
 nobase_include_HEADERS = mcrypt.h mutils/mcrypt.h
 
-dist-hook:
-	find $(distdir) -name CVS -o -name .cvsignore | xargs rm -rf
-
--- libmcrypt-2.5.8.orig/lib/Makefile.am
+++ libmcrypt-2.5.8/lib/Makefile.am
@@ -1,16 +1,17 @@
 DEFS = @DEFS@ -DLIBDIR=\"$(libdir)/@PACKAGE@/\" 
-INCLUDES = -I. -I.. $(INCLTDL) -I../modules/algorithms -I../modules/modes
+AM_CPPFLAGS = -I. -I.. $(INCLTDL) -I../modules/algorithms -I../modules/modes
 EXTRA_DIST = libdefs.h bzero.h xmemory.h mcrypt_modules.h mcrypt_internal.h \
  libmcrypt.sym win32_comp.h mcrypt.h.in libmcrypt-config.in libmcrypt.m4
 lib_LTLIBRARIES = libmcrypt.la 
 
-libmcrypt_la_SOURCES = mcrypt_extra.c mcrypt.c bzero.c xmemory.c mcrypt_modules.c win32_comp.c mcrypt_threads.c \
+libmcrypt_la_SOURCES = mcrypt_extra.c mcrypt.c bzero.c xmemory.c \
+		       mcrypt_modules.c win32_comp.c mcrypt_threads.c \
 	mcrypt_symb.c 
 
-libmcrypt_la_LDFLAGS =  \
+libmcrypt_la_LDFLAGS =  -enable-runtime-pseudo-reloc -no-undefined \
 	  -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-	  -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-	  -export-symbols libmcrypt.sym @LIBLTDL@ 
+	  -export-symbols libmcrypt.sym @LIBLTDL@ \
+	  -Wl,--out-implib,libmcrypt.a
 libmcrypt_la_LIBADD = @EXTRA_OBJECTS@
 
 m4datadir = $(datadir)/aclocal
@@ -23,8 +24,8 @@ mcrypt_symb.c: mcrypt_internal.h
 	@echo "/* This is automatically created. Don't touch... */" >> mcrypt_symb.c
 	@echo "" >> mcrypt_symb.c
 	-@for i in $(EXTRA_ALGOS); do \
-		if test -f ../modules/algorithms/$$i.c; then cat ../modules/algorithms/$$i.c 2>/dev/null|grep define|grep LTX|awk '{print "extern "$$3"();";}' >> mcrypt_symb.c 2>/dev/null; fi; \
-		if test -f ../modules/modes/$$i.c; then cat ../modules/modes/$$i.c 2>/dev/null|grep define|grep LTX|awk '{print "extern "$$3"();";}' >> mcrypt_symb.c 2>/dev/null; fi; \
+		if test -f ../modules/algorithms/$$i.c; then cat ../modules/algorithms/$$i.c 2>/dev/null|grep define|grep LTX|awk '{print "extern int "$$3"();";}' >> mcrypt_symb.c 2>/dev/null; fi; \
+		if test -f ../modules/modes/$$i.c; then cat ../modules/modes/$$i.c 2>/dev/null|grep define|grep LTX|awk '{print "extern int "$$3"();";}' >> mcrypt_symb.c 2>/dev/null; fi; \
 	done
 	@echo "" >> mcrypt_symb.c
 	@echo "const mcrypt_preloaded mps[] = {" >> mcrypt_symb.c
--- libmcrypt-2.5.8.orig/lib/mcrypt_modules.h
+++ libmcrypt-2.5.8/lib/mcrypt_modules.h
@@ -1,7 +1,7 @@
-#define rotl32(x,n)   (((x) << ((word32)(n))) | ((x) >> (32 - (word32)(n))))
-#define rotr32(x,n)   (((x) >> ((word32)(n))) | ((x) << (32 - (word32)(n))))
-#define rotl16(x,n)   (((x) << ((word16)(n))) | ((x) >> (16 - (word16)(n))))
-#define rotr16(x,n)   (((x) >> ((word16)(n))) | ((x) << (16 - (word16)(n))))
+#define rotl32(x,n)   (((x) << ((word32)(n & 31))) | ((x) >> (32 - (word32)(n & 31))))
+#define rotr32(x,n)   (((x) >> ((word32)(n & 31))) | ((x) << (32 - (word32)(n & 31))))
+#define rotl16(x,n)   (((x) << ((word16)(n & 15))) | ((x) >> (16 - (word16)(n & 15))))
+#define rotr16(x,n)   (((x) >> ((word16)(n & 15))) | ((x) << (16 - (word16)(n & 15))))
 
 /* Use hardware rotations.. when available */
 #ifdef swap32
--- libmcrypt-2.5.8.orig/modules/algorithms/3-way.c
+++ libmcrypt-2.5.8/modules/algorithms/3-way.c
@@ -69,7 +69,7 @@ void mu(word32 * a)
 	a[2] = b[2];
 }
 
-void gamma(word32 * a)
+void gamma3w(word32 * a)
 {				/* the nonlinear step */
 	word32 b[3];
 
@@ -130,7 +130,7 @@ void rho(word32 * a)
 {				/* the round function       */
 	theta(a);
 	pi_1(a);
-	gamma(a);
+	gamma3w(a);
 	pi_2(a);
 }
 
--- libmcrypt-2.5.8.orig/modules/algorithms/Makefile.am
+++ libmcrypt-2.5.8/modules/algorithms/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 DEFS = @DEFS@ 
-INCLUDES = -I. -I../.. $(INCLTDL) -I../../lib
+AM_CPPFLAGS = -I. -I../.. $(INCLTDL) -I../../lib
 
 EXTRA_DIST = twofish.h saferplus.h rijndael.h \
 		rc2.h serpent.h cast-256.h blowfish.h \
@@ -19,48 +19,48 @@ EXTRA_LTLIBRARIES = twofish.la rijndael-
 noinst_LTLIBRARIES = @NOINSTALL_ALGORITHM_MODULES@
 
 twofish_la_SOURCES = twofish.c
-twofish_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+twofish_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 wake_la_SOURCES = wake.c
-wake_la_LDFLAGS =  -module -avoid-version  -rpath $(pkglibdir)
+wake_la_LDFLAGS =  -module -avoid-version -no-undefined  -rpath $(pkglibdir)
 panama_la_SOURCES = panama.c
-panama_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+panama_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 rijndael_128_la_SOURCES = rijndael-128.c
-rijndael_128_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+rijndael_128_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 rijndael_192_la_SOURCES = rijndael-192.c
-rijndael_192_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+rijndael_192_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 rijndael_256_la_SOURCES = rijndael-256.c
-rijndael_256_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir) 
+rijndael_256_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir) 
 saferplus_la_SOURCES = saferplus.c
-saferplus_la_LDFLAGS =  -module -avoid-version  -rpath $(pkglibdir)
+saferplus_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 serpent_la_SOURCES = serpent.c
-serpent_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+serpent_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 xtea_la_SOURCES = xtea.c
-xtea_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+xtea_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 rc2_la_SOURCES = rc2.c
-rc2_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+rc2_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 safer_sk64_la_SOURCES = safer64.c
-safer_sk64_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+safer_sk64_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 safer_sk128_la_SOURCES = safer128.c
-safer_sk128_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir) 
+safer_sk128_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir) 
 cast_256_la_SOURCES = cast-256.c
-cast_256_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+cast_256_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 loki97_la_SOURCES = loki97.c
-loki97_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+loki97_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 gost_la_SOURCES = gost.c
-gost_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+gost_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 threeway_la_SOURCES = 3-way.c
-threeway_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+threeway_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 blowfish_la_SOURCES = blowfish.c
-blowfish_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir) 
+blowfish_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir) 
 blowfish_compat_la_SOURCES = blowfish-compat.c
-blowfish_compat_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+blowfish_compat_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 cast_128_la_SOURCES = cast-128.c
-cast_128_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+cast_128_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 des_la_SOURCES = des.c
-des_la_LDFLAGS =  -module -avoid-version  -rpath $(pkglibdir)
+des_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 tripledes_la_SOURCES = tripledes.c
-tripledes_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+tripledes_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 enigma_la_SOURCES = enigma.c
-enigma_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+enigma_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 arcfour_la_SOURCES = arcfour.c
-arcfour_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+arcfour_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
--- libmcrypt-2.5.8.orig/modules/algorithms/cast-128.c
+++ libmcrypt-2.5.8/modules/algorithms/cast-128.c
@@ -317,7 +317,7 @@ WIN32DLL_DEFINE int _mcrypt_get_key_size
 	return 16;
 }
 
-static const int key_sizes[] = { 16 };
+static const int key_sizes[] = { 5, 10, 16 };
 WIN32DLL_DEFINE const int *_mcrypt_get_supported_key_sizes(int *len)
 {
 	*len = sizeof(key_sizes)/sizeof(int);
--- libmcrypt-2.5.8.orig/modules/algorithms/des.c
+++ libmcrypt-2.5.8/modules/algorithms/des.c
@@ -35,9 +35,12 @@
 
 /* #define	NULL	0 */
 
-static void permute_ip(), permute_fp(), perminit_ip(), spinit(),
-perminit_fp();
-static word32 f();
+static void permute_ip(char *, DES_KEY *, char *);
+static void permute_fp(char *, DES_KEY *, char *);
+static void perminit_ip(DES_KEY *);
+static void spinit(DES_KEY *);
+static void perminit_fp(DES_KEY *);
+static word32 f(DES_KEY *, register word32, register char *);
 
 
 /* Tables defined in the Data Encryption Standard documents */
--- libmcrypt-2.5.8.orig/modules/algorithms/tripledes.c
+++ libmcrypt-2.5.8/modules/algorithms/tripledes.c
@@ -36,8 +36,10 @@
 
 /* #define	NULL	0 */
 
-static void permute(), perminit(), spinit();
-static word32 f();
+static void permute(char *, char[16][16][8], char *);
+static void perminit(char[16][16][8], char[64]);
+static void spinit(TRIPLEDES_KEY *, int);
+static word32 f(TRIPLEDES_KEY *, int, register word32, register char *);
 
 
 /* Tables defined in the Data Encryption Standard documents */
--- libmcrypt-2.5.8.orig/modules/algorithms/twofish.c
+++ libmcrypt-2.5.8/modules/algorithms/twofish.c
@@ -499,7 +499,7 @@ static void f_rnd(int i, word32* blk, TW
 /* encrypt a block of text  */
 WIN32DLL_DEFINE void _mcrypt_encrypt(TWI * pkey, word32 * in_blk)
 {
-	word32 t0, t1, blk[4];
+	word32 t0 = 0, t1 = 0, blk[4];
 #ifdef WORDS_BIGENDIAN
 	blk[0] = byteswap32(in_blk[0]) ^ pkey->l_key[0];
 	blk[1] = byteswap32(in_blk[1]) ^ pkey->l_key[1];
--- libmcrypt-2.5.8.orig/modules/modes/Makefile.am
+++ libmcrypt-2.5.8/modules/modes/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 DEFS = @DEFS@ 
-INCLUDES = -I. -I../.. $(INCLTDL) -I../../lib
+AM_CPPFLAGS = -I. -I../.. $(INCLTDL) -I../../lib
 
 EXTRA_DIST = ofb.h cfb.h nofb.h cbc.h ecb.h stream.h ncfb.h ctr.h
 pkglib_LTLIBRARIES = @INSTALL_MODE_MODULES@
@@ -10,18 +10,18 @@ EXTRA_LTLIBRARIES = ofb.la cfb.la nofb.l
 noinst_LTLIBRARIES = @NOINSTALL_MODE_MODULES@
 
 ofb_la_SOURCES = ofb.c
-ofb_la_LDFLAGS =  -module -avoid-version  -rpath $(pkglibdir)
+ofb_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 ctr_la_SOURCES = ctr.c
-ctr_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+ctr_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
 cfb_la_SOURCES = cfb.c
-cfb_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir) 
+cfb_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir) 
 ncfb_la_SOURCES = ncfb.c
-ncfb_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)  
+ncfb_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)  
 nofb_la_SOURCES = nofb.c
-nofb_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)  
+nofb_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)  
 ecb_la_SOURCES = ecb.c
-ecb_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)  
+ecb_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)  
 cbc_la_SOURCES = cbc.c
-cbc_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)  
+cbc_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)  
 stream_la_SOURCES = stream.c
-stream_la_LDFLAGS =  -module -avoid-version -rpath $(pkglibdir)
+stream_la_LDFLAGS =  -module -avoid-version -no-undefined -rpath $(pkglibdir)
