summaryrefslogtreecommitdiff
path: root/beecrypt
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-04-10 20:00:40 +0000
committerjbj <devnull@localhost>2002-04-10 20:00:40 +0000
commite5a632b26dc0f8df7f552dcf0a07f703db9fd329 (patch)
tree0748845b10f4b3c23064bbc6d940091c27659a12 /beecrypt
parentfa1361480f0b9a1154579a21668a249d0bce6126 (diff)
downloadlibrpm-tizen-e5a632b26dc0f8df7f552dcf0a07f703db9fd329.tar.gz
librpm-tizen-e5a632b26dc0f8df7f552dcf0a07f703db9fd329.tar.bz2
librpm-tizen-e5a632b26dc0f8df7f552dcf0a07f703db9fd329.zip
- beecrypt: add types.h, eliminate need for config.gnu.h.
CVS patchset: 5386 CVS date: 2002/04/10 20:00:40
Diffstat (limited to 'beecrypt')
-rw-r--r--beecrypt/.cvsignore5
-rw-r--r--beecrypt/Makefile.am5
-rw-r--r--beecrypt/Makefile.in55
-rw-r--r--beecrypt/base64.c19
-rw-r--r--beecrypt/beecrypt.c17
-rw-r--r--beecrypt/beecrypt.h4
-rw-r--r--beecrypt/beetest.c14
-rw-r--r--beecrypt/blockmode.c4
-rw-r--r--beecrypt/blockpad.c14
-rw-r--r--beecrypt/blowfish.c6
-rw-r--r--beecrypt/config.gas.h30
-rw-r--r--beecrypt/config.h272
-rw-r--r--beecrypt/config.h.in (renamed from beecrypt/config.gnu.h.in)2
-rw-r--r--beecrypt/configure.in32
-rw-r--r--beecrypt/debug.h20
-rw-r--r--beecrypt/dhaes.c11
-rw-r--r--beecrypt/dldp.c11
-rw-r--r--beecrypt/dlkp.c4
-rw-r--r--beecrypt/dlpk.c4
-rw-r--r--beecrypt/dlsvdp-dh.c4
-rw-r--r--beecrypt/docs/Makefile.in12
-rw-r--r--beecrypt/dsa.c11
-rw-r--r--beecrypt/elgamal.c11
-rw-r--r--beecrypt/endianness.c10
-rw-r--r--beecrypt/entropy.c26
-rw-r--r--beecrypt/fips180.c4
-rw-r--r--beecrypt/fips186.c11
-rw-r--r--beecrypt/gas/Makefile.in12
-rw-r--r--beecrypt/hmac.c4
-rw-r--r--beecrypt/hmacmd5.c4
-rw-r--r--beecrypt/hmacsha1.c4
-rw-r--r--beecrypt/hmacsha256.c4
-rw-r--r--beecrypt/javaglue.c9
-rw-r--r--beecrypt/masm/Makefile.in12
-rw-r--r--beecrypt/md5.c4
-rw-r--r--beecrypt/memchunk.c11
-rw-r--r--beecrypt/memchunk.h4
-rw-r--r--beecrypt/mp32.c6
-rw-r--r--beecrypt/mp32barrett.c13
-rw-r--r--beecrypt/mp32number.c11
-rw-r--r--beecrypt/mp32number.h4
-rw-r--r--beecrypt/mp32prime.c13
-rw-r--r--beecrypt/mtprng.c11
-rw-r--r--beecrypt/mwerks/Makefile.in12
-rw-r--r--beecrypt/rsa.c11
-rw-r--r--beecrypt/rsakp.c14
-rw-r--r--beecrypt/rsapk.c8
-rw-r--r--beecrypt/sha256.c4
-rw-r--r--beecrypt/system.h72
-rw-r--r--beecrypt/tests/Makefile.in12
-rw-r--r--beecrypt/timestamp.c11
-rw-r--r--beecrypt/types.h.in71
52 files changed, 596 insertions, 363 deletions
diff --git a/beecrypt/.cvsignore b/beecrypt/.cvsignore
index 52496e94f..9bcac96b0 100644
--- a/beecrypt/.cvsignore
+++ b/beecrypt/.cvsignore
@@ -6,11 +6,11 @@ Doxyfile
Makefile
Makefile.in
apidocs
-becrypt.spec
+beecrypt.spec
beecrypt-*.tar.gz
+config.h
config.cache
config.guess
-config.gnu.h
config.log
config.status
config.sub
@@ -27,3 +27,4 @@ ltmain.sh
stamp-h
stamp-h1
stamp-h.in
+types.h
diff --git a/beecrypt/Makefile.am b/beecrypt/Makefile.am
index 78a7c24a3..591bbd547 100644
--- a/beecrypt/Makefile.am
+++ b/beecrypt/Makefile.am
@@ -56,7 +56,10 @@ libbeecrypt_la_LDFLAGS = -version-info $(LIBBEECRYPT_LT_CURRENT):$(LIBBEECRYPT_L
pkginclude_HEADERS = base64.h beecrypt.h blockmode.h blockpad.h blowfish.h blowfishopt.h dhaes.h dldp.h dlkp.h dlpk.h dlsvdp-dh.h dsa.h elgamal.h endianness.h entropy.h fips180.h fips180opt.h fips186.h hmac.h hmacmd5.h hmacsha1.h hmacsha256.h md5.h memchunk.h mp32.h mp32barrett.h mp32number.h mp32opt.h mp32prime.h mtprng.h rsa.h rsakp.h rsapk.h sha256.h timestamp.h
-EXTRA_DIST = BENCHMARKS BUGS CONTRIBUTORS Doxyfile.in Doxyheader README.DLL README.WIN32 beecrypt.def beecrypt.mcp beecrypt.rc beecrypt.spec config.h config.gas.h config.win.h javaglue.h
+EXTRA_DIST = BENCHMARKS BUGS CONTRIBUTORS Doxyfile.in Doxyheader README.DLL README.WIN32 beecrypt.def beecrypt.mcp beecrypt.rc beecrypt.spec types.h config.gas.h config.win.h javaglue.h
+
+noinst_HEADERS = debug.h system.h
+BUILT_SOURCES = blowfishopt.S fips180opt.S mp32opt.S
.PHONY: beetest
beetest: all
diff --git a/beecrypt/Makefile.in b/beecrypt/Makefile.in
index ba22212e9..e9536c1b1 100644
--- a/beecrypt/Makefile.in
+++ b/beecrypt/Makefile.in
@@ -116,7 +116,17 @@ ac_cv_have_java = @ac_cv_have_java@
ac_cv_have_javac = @ac_cv_have_javac@
am__include = @am__include@
am__quote = @am__quote@
+double8_type = @double8_type@
+float4_type = @float4_type@
install_sh = @install_sh@
+int16_type = @int16_type@
+int32_type = @int32_type@
+int64_type = @int64_type@
+int8_type = @int8_type@
+uint16_type = @uint16_type@
+uint32_type = @uint32_type@
+uint64_type = @uint64_type@
+uint8_type = @uint8_type@
LIBBEECRYPT_LT_CURRENT = 4
LIBBEECRYPT_LT_AGE = 2
@@ -144,14 +154,17 @@ libbeecrypt_la_LDFLAGS = -version-info $(LIBBEECRYPT_LT_CURRENT):$(LIBBEECRYPT_L
pkginclude_HEADERS = base64.h beecrypt.h blockmode.h blockpad.h blowfish.h blowfishopt.h dhaes.h dldp.h dlkp.h dlpk.h dlsvdp-dh.h dsa.h elgamal.h endianness.h entropy.h fips180.h fips180opt.h fips186.h hmac.h hmacmd5.h hmacsha1.h hmacsha256.h md5.h memchunk.h mp32.h mp32barrett.h mp32number.h mp32opt.h mp32prime.h mtprng.h rsa.h rsakp.h rsapk.h sha256.h timestamp.h
-EXTRA_DIST = BENCHMARKS BUGS CONTRIBUTORS Doxyfile.in Doxyheader README.DLL README.WIN32 beecrypt.def beecrypt.mcp beecrypt.rc beecrypt.spec config.h config.gas.h config.win.h javaglue.h
+EXTRA_DIST = BENCHMARKS BUGS CONTRIBUTORS Doxyfile.in Doxyheader README.DLL README.WIN32 beecrypt.def beecrypt.mcp beecrypt.rc beecrypt.spec types.h config.gas.h config.win.h javaglue.h
+
+noinst_HEADERS = debug.h system.h
+BUILT_SOURCES = blowfishopt.S fips180opt.S mp32opt.S
DOXYGEN = /usr/bin/doxygen
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = config.gnu.h
-CONFIG_CLEAN_FILES = Doxyfile beecrypt.spec
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = Doxyfile beecrypt.spec types.h
LTLIBRARIES = $(lib_LTLIBRARIES)
am_libbeecrypt_la_OBJECTS = base64.lo beecrypt.lo blockmode.lo \
@@ -178,22 +191,23 @@ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
CFLAGS = @CFLAGS@
DIST_SOURCES = $(libbeecrypt_la_SOURCES)
-HEADERS = $(pkginclude_HEADERS)
+HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS)
RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
uninstall-info-recursive all-recursive install-data-recursive \
install-exec-recursive installdirs-recursive install-recursive \
uninstall-recursive check-recursive installcheck-recursive
-DIST_COMMON = README $(pkginclude_HEADERS) ./stamp-h.in AUTHORS COPYING \
- COPYING.LIB ChangeLog Doxyfile.in INSTALL Makefile.am \
- Makefile.in NEWS acconfig.h aclocal.m4 beecrypt.spec.in \
- config.gnu.h.in config.guess config.sub configure configure.in \
- depcomp install-sh ltconfig ltmain.sh missing mkinstalldirs
+DIST_COMMON = README $(noinst_HEADERS) $(pkginclude_HEADERS) \
+ ./stamp-h.in AUTHORS COPYING COPYING.LIB ChangeLog Doxyfile.in \
+ INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 \
+ beecrypt.spec.in config.guess config.h.in config.sub configure \
+ configure.in depcomp install-sh ltconfig ltmain.sh missing \
+ mkinstalldirs types.h.in
DIST_SUBDIRS = $(SUBDIRS)
SOURCES = $(libbeecrypt_la_SOURCES)
-all: config.gnu.h
+all: $(BUILT_SOURCES) config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
@@ -222,19 +236,19 @@ $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENC
$(ACLOCAL_M4): configure.in
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-config.gnu.h: stamp-h
+config.h: stamp-h
@if test ! -f $@; then \
rm -f stamp-h; \
$(MAKE) stamp-h; \
else :; fi
-stamp-h: $(srcdir)/config.gnu.h.in $(top_builddir)/config.status
+stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h stamp-hT
@echo timestamp > stamp-hT 2> /dev/null
cd $(top_builddir) \
- && CONFIG_FILES= CONFIG_HEADERS=config.gnu.h \
+ && CONFIG_FILES= CONFIG_HEADERS=config.h \
$(SHELL) ./config.status
@mv stamp-hT stamp-h
-$(srcdir)/config.gnu.h.in: $(srcdir)/./stamp-h.in
+$(srcdir)/config.h.in: $(srcdir)/./stamp-h.in
@if test ! -f $@; then \
rm -f $(srcdir)/./stamp-h.in; \
$(MAKE) $(srcdir)/./stamp-h.in; \
@@ -246,11 +260,13 @@ $(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/a
@mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in
distclean-hdr:
- -rm -f config.gnu.h
+ -rm -f config.h
Doxyfile: $(top_builddir)/config.status Doxyfile.in
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status
beecrypt.spec: $(top_builddir)/config.status beecrypt.spec.in
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status
+types.h: $(top_builddir)/config.status types.h.in
+ cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(libdir)
@@ -372,7 +388,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
END { for (i in files) print i; }'`; \
mkid -fID $$unique $(LISP)
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.gnu.h.in $(TAGS_DEPENDENCIES) \
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
@@ -387,8 +403,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.gnu.h.in $(TAGS_DEPENDENCIES)
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)config.gnu.h.in$$unique$(LISP)$$tags" \
- || etags $(ETAGS_ARGS) $$tags config.gnu.h.in $$unique $(LISP)
+ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
+ || etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP)
GTAGS:
here=`CDPATH=: && cd $(top_builddir) && pwd` \
@@ -485,7 +501,7 @@ distcheck: dist
sed 'h;s/./=/g;p;x;p;x'
check-am: all-am
check: check-recursive
-all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.gnu.h
+all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h
installdirs: installdirs-recursive
installdirs-am:
$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(pkgincludedir)
@@ -513,6 +529,7 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-recursive
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
diff --git a/beecrypt/base64.c b/beecrypt/base64.c
index ea53453c1..15103eec7 100644
--- a/beecrypt/base64.c
+++ b/beecrypt/base64.c
@@ -25,28 +25,13 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "base64.h"
+#include "debug.h"
/*@unchecked@*/
static int _debug = 0;
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_STRING_H
-# include <string.h>
-#endif
-#if HAVE_CTYPE_H
-# include <ctype.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#include <stdio.h>
-
/*@unchecked@*/ /*@observer@*/
static const char* to_b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
diff --git a/beecrypt/beecrypt.c b/beecrypt/beecrypt.c
index 21f88924a..e614f1b24 100644
--- a/beecrypt/beecrypt.c
+++ b/beecrypt/beecrypt.c
@@ -26,22 +26,9 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "beecrypt.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
-#if HAVE_STRING_H
-# include <string.h>
-#endif
-#if WIN32
-# include <windows.h>
-#endif
+#include "debug.h"
#if defined(__LCLINT__)
/* XXX from /usr/include/bits/sigest.h in glibc-2.2.4 */
diff --git a/beecrypt/beecrypt.h b/beecrypt/beecrypt.h
index 289499d46..ebca53236 100644
--- a/beecrypt/beecrypt.h
+++ b/beecrypt/beecrypt.h
@@ -26,9 +26,7 @@
#ifndef _BEECRYPT_H
#define _BEECRYPT_H
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "types.h"
#include "memchunk.h"
#include "mp32number.h"
diff --git a/beecrypt/beetest.c b/beecrypt/beetest.c
index cb2ddc894..cf568a425 100644
--- a/beecrypt/beetest.c
+++ b/beecrypt/beetest.c
@@ -23,6 +23,7 @@
*
*/
+#include "system.h"
#include "beecrypt.h"
#include "blockmode.h"
#include "blowfish.h"
@@ -35,18 +36,7 @@
#include "md5.h"
#include "rsa.h"
#include "sha256.h"
-
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#if HAVE_TIME_H
-#include <time.h>
-#endif
-
-#include <stdio.h>
+#include "debug.h"
static const char* dsa_p = "8df2a494492276aa3d25759bb06869cbeac0d83afb8d0cf7cbb8324f0d7882e5d0762fc5b7210eafc2e9adac32ab7aac49693dfbf83724c2ec0736ee31c80291";
static const char* dsa_q = "c773218c737ec8ee993b4f2ded30f48edace915f";
diff --git a/beecrypt/blockmode.c b/beecrypt/blockmode.c
index 92da8309e..d803459ec 100644
--- a/beecrypt/blockmode.c
+++ b/beecrypt/blockmode.c
@@ -25,10 +25,10 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "blockmode.h"
#include "mp32.h"
+#include "debug.h"
int blockEncrypt(const blockCipher* bc, blockCipherParam* bp, cipherMode mode, int blocks, uint32* dst, const uint32* src)
{
diff --git a/beecrypt/blockpad.c b/beecrypt/blockpad.c
index 7bf7ca713..f4ec46f09 100644
--- a/beecrypt/blockpad.c
+++ b/beecrypt/blockpad.c
@@ -25,19 +25,9 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "blockpad.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
-#if HAVE_STRING_H
-# include <string.h>
-#endif
+#include "debug.h"
memchunk* pkcs5Pad(int blockbytes, memchunk* tmp)
{
diff --git a/beecrypt/blowfish.c b/beecrypt/blowfish.c
index 7eaec7a69..61adec10f 100644
--- a/beecrypt/blowfish.c
+++ b/beecrypt/blowfish.c
@@ -32,12 +32,10 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "blowfish.h"
#include "endianness.h"
-
-#include <string.h>
+#include "debug.h"
/**
*/
diff --git a/beecrypt/config.gas.h b/beecrypt/config.gas.h
index 66d6b0132..f27de3f9e 100644
--- a/beecrypt/config.gas.h
+++ b/beecrypt/config.gas.h
@@ -1,7 +1,7 @@
#ifndef _CONFIG_GAS_H
#define _CONFIG_GAS_H
-#include "config.gnu.h"
+#include "config.h"
#ifndef C_FUNCTION_NAME
# if LEADING_UNDERSCORE
@@ -31,6 +31,17 @@
# define ALIGNMENT 8
#endif
+#define LABEL(name) C_FUNCTION_NAME(name):
+#if DARWIN
+# define LOCAL(name) L##name
+#else
+# if __STDC__
+# define LOCAL(name) .L##name
+# else
+# define LOCAL(name) .L/**/name
+# endif
+#endif
+
#if CYGWIN
# define C_FUNCTION_BEGIN(name) \
.align ALIGNMENT; \
@@ -38,8 +49,7 @@
.def C_FUNCTION_NAME(name); \
.scl 2; \
.type 32; \
- .endef; \
-C_FUNCTION_NAME(name):
+ .endef
# define C_FUNCTION_END(name, label)
#else
# if SOLARIS
@@ -51,23 +61,21 @@ C_FUNCTION_NAME(name):
# endif
# if DARWIN
# define C_FUNCTION_BEGIN(name) \
- .type C_FUNCTION_NAME(name),C_FUNCTION_TYPE; \
-C_FUNCTION_NAME(name):
+ .globl C_FUNCTION_NAME(name)
+# define C_FUNCTION_END(name, label)
# elif defined(OPTIMIZE_IA64)
# define C_FUNCTION_BEGIN(name) \
.align ALIGNMENT; \
.global name#; \
- .proc name#; \
-name:
+ .proc name#
# define C_FUNCTION_END(name) \
.endp name#
# else
# define C_FUNCTION_BEGIN(name) \
.align ALIGNMENT; \
- .global C_FUNCTION_NAME(name); \
-C_FUNCTION_NAME(name):
-# define C_FUNCTION_END(name, label) \
- label: .size name,label-name;
+ .global C_FUNCTION_NAME(name)
+# define C_FUNCTION_END(name, label) \
+ label: .size C_FUNCTION_NAME(name), label - C_FUNCTION_NAME(name);
# endif
#endif
diff --git a/beecrypt/config.h b/beecrypt/config.h
index dbab02eff..08f796d42 100644
--- a/beecrypt/config.h
+++ b/beecrypt/config.h
@@ -1,9 +1,11 @@
+/* config.h. Generated automatically by configure. */
+/* config.h.in. Generated automatically from configure.in by autoheader. */
/*
- * config.h
+ * acconfig.h
*
- * Config.h generic config file
+ * acconfig.h pre-announces symbols defines by configure.in
*
- * Copyright (c) 2000 Virtual Unlimited B.V.
+ * Copyright (c) 2001 Virtual Unlimited B.V.
*
* Author: Bob Deblier <bob@virtualunlimited.com>
*
@@ -23,57 +25,239 @@
*
*/
-#ifndef _CONFIG_H
-#define _CONFIG_H
+#ifndef _REENTRANT
+#define _REENTRANT
+#endif
-#if defined(_WIN32) && !defined(WIN32)
-# define WIN32 1
+#define AIX 0
+#define BEOS 0
+#define CYGWIN 0
+#define DARWIN 0
+#define FREEBSD 0
+#define HPUX 0
+#define LINUX 1
+#define MACOSX 0
+#define NETBSD 0
+#define OPENBSD 0
+#define OSF 0
+#define QNX 0
+#define SCO_UNIX 0
+#define SOLARIS 0
+#ifndef WIN32
+# define WIN32 0
#endif
+#define LEADING_UNDERSCORE 0
+#define NO_UNDERSCORES 1
-#if WIN32 && !__CYGWIN32__
-# include "config.win.h"
-# ifdef BEECRYPT_DLL_EXPORT
-# define BEECRYPTAPI __declspec(dllexport)
-# else
-# define BEECRYPTAPI __declspec(dllimport)
-# endif
-/*typedef UINT8_TYPE byte;*/
-#else
-# include "config.gnu.h"
-# define BEECRYPTAPI
-typedef UINT8_TYPE byte;
-#endif
+#define JAVAGLUE 0
+
+#define HAVE_ERRNO_H 1
+#define HAVE_STRING_H 1
+#define HAVE_CTYPE_H 1
+#define HAVE_STDLIB_H 1
+/* #undef HAVE_MTMALLOC_H */
+
+#define HAVE_UNISTD_H 1
+#define HAVE_FCNTL_H 1
+
+#define HAVE_TIME_H 1
+
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_TIME_H 1
+
+#define ENABLE_THREADS 1
+/* #undef HAVE_THREAD_H */
+#define HAVE_PTHREAD_H 1
+/* #undef HAVE_SYNCH_H */
+#define HAVE_SEMAPHORE_H 1
+
+#define ENABLE_AIO 1
+#define HAVE_AIO_H 1
+
+#define HAVE_TERMIO_H 1
+#define HAVE_TERMIOS_H 1
+
+/* #undef HAVE_SYS_AUDIOIO_H */
+#define HAVE_SYS_IOCTL_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+
+#define HAVE_GETTIMEOFDAY 1
+/* #undef HAVE_GETHRTIME */
+
+#define HAVE_DEV_DSP 1
+/* #undef HAVE_DEV_AUDIO */
+#define HAVE_DEV_RANDOM 1
+#define HAVE_DEV_URANDOM 1
+#define HAVE_DEV_TTY 1
+
+#define HAVE_LONG_LONG 1
+#define HAVE_UNSIGNED_LONG_LONG 1
+
+/* #undef INT8_TYPE */
+/* #undef INT16_TYPE */
+/* #undef INT32_TYPE */
+/* #undef INT64_TYPE */
+
+/* #undef UINT8_TYPE */
+/* #undef UINT16_TYPE */
+/* #undef UINT32_TYPE */
+/* #undef UINT64_TYPE */
-#ifndef ROTL32
-# define ROTL32(x, s) (((x) << (s)) | ((x) >> (32 - (s))))
+/* #undef FLOAT4_TYPE */
+/* #undef DOUBLE8_TYPE */
+
+#if LINUX
+#define _LIBC_REENTRANT
#endif
-#ifndef ROTR32
-# define ROTR32(x, s) (((x) >> (s)) | ((x) << (32 - (s))))
+
+#ifndef __cplusplus
+/* #undef inline */
#endif
-/*@-typeuse@*/
-typedef INT8_TYPE int8;
-/*@=typeuse@*/
-typedef INT16_TYPE int16;
-typedef INT32_TYPE int32;
-typedef INT64_TYPE int64;
+/* Define if you have the <aio.h> header file. */
+#define HAVE_AIO_H 1
-typedef UINT8_TYPE uint8;
-typedef UINT16_TYPE uint16;
-typedef UINT32_TYPE uint32;
-/*@-duplicatequals@*/
-typedef UINT64_TYPE uint64;
-/*@=duplicatequals@*/
+/* Define if you have the <ctype.h> header file. */
+#define HAVE_CTYPE_H 1
-typedef INT8_TYPE javabyte;
-typedef INT16_TYPE javashort;
-typedef INT32_TYPE javaint;
-typedef INT64_TYPE javalong;
+/* Define if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
-typedef UINT16_TYPE javachar;
+/* Define if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
-typedef FLOAT4_TYPE javafloat;
-typedef DOUBLE8_TYPE javadouble;
+/* Define if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
-#endif
+/* Define if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define if you have the `mtmalloc' library (-lmtmalloc). */
+/* #undef HAVE_LIBMTMALLOC */
+
+/* Define if you have the `pthread' library (-lpthread). */
+#define HAVE_LIBPTHREAD 1
+
+/* Define if you have the `thread' library (-lthread). */
+/* #undef HAVE_LIBTHREAD */
+
+/* Define if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define if you have the <mtmalloc.h> header file. */
+/* #undef HAVE_MTMALLOC_H */
+
+/* Define if you have the <pthread.h> header file. */
+#define HAVE_PTHREAD_H 1
+
+/* Define if you have the <semaphore.h> header file. */
+#define HAVE_SEMAPHORE_H 1
+
+/* Define if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define if you have the <synch.h> header file. */
+/* #undef HAVE_SYNCH_H */
+
+/* Define if you have the <sys/audioio.h> header file. */
+/* #undef HAVE_SYS_AUDIOIO_H */
+
+/* Define if you have the <sys/ioctl.h> header file. */
+#define HAVE_SYS_IOCTL_H 1
+
+/* Define if you have the <sys/soundcard.h> header file. */
+#define HAVE_SYS_SOUNDCARD_H 1
+
+/* Define if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define if you have the <termios.h> header file. */
+#define HAVE_TERMIOS_H 1
+
+/* Define if you have the <termio.h> header file. */
+#define HAVE_TERMIO_H 1
+
+/* Define if you have the <thread.h> header file. */
+/* #undef HAVE_THREAD_H */
+
+/* Define if you have the <time.h> header file. */
+#define HAVE_TIME_H 1
+
+/* Define if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Name of package */
+#define PACKAGE "beecrypt"
+
+/* The size of a `char', as computed by sizeof. */
+#define SIZEOF_CHAR 1
+
+/* The size of a `double', as computed by sizeof. */
+#define SIZEOF_DOUBLE 8
+
+/* The size of a `float', as computed by sizeof. */
+#define SIZEOF_FLOAT 4
+
+/* The size of a `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of a `long', as computed by sizeof. */
+#define SIZEOF_LONG 4
+
+/* The size of a `long long', as computed by sizeof. */
+#define SIZEOF_LONG_LONG 8
+
+/* The size of a `short', as computed by sizeof. */
+#define SIZEOF_SHORT 2
+
+/* The size of a `unsigned char', as computed by sizeof. */
+#define SIZEOF_UNSIGNED_CHAR 1
+
+/* The size of a `unsigned int', as computed by sizeof. */
+#define SIZEOF_UNSIGNED_INT 4
+
+/* The size of a `unsigned long', as computed by sizeof. */
+#define SIZEOF_UNSIGNED_LONG 4
+
+/* The size of a `unsigned long long', as computed by sizeof. */
+#define SIZEOF_UNSIGNED_LONG_LONG 8
+
+/* The size of a `unsigned short', as computed by sizeof. */
+#define SIZEOF_UNSIGNED_SHORT 2
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "2.2.0"
+
+/* Define if your processor stores words with the most significant byte first
+ (like Motorola and SPARC, unlike Intel and VAX). */
+/* #undef WORDS_BIGENDIAN */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+ if it is not supported. */
+/* #undef inline */
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+/* #undef size_t */
diff --git a/beecrypt/config.gnu.h.in b/beecrypt/config.h.in
index f93c9e1d6..8bd2412fd 100644
--- a/beecrypt/config.gnu.h.in
+++ b/beecrypt/config.h.in
@@ -1,4 +1,4 @@
-/* config.gnu.h.in. Generated automatically from configure.in by autoheader. */
+/* config.h.in. Generated automatically from configure.in by autoheader. */
/*
* acconfig.h
*
diff --git a/beecrypt/configure.in b/beecrypt/configure.in
index d29aca05b..36b1e986a 100644
--- a/beecrypt/configure.in
+++ b/beecrypt/configure.in
@@ -4,7 +4,7 @@ dnl Initialization
AC_INIT(beecrypt.c)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(beecrypt, 2.2.0)
-AM_CONFIG_HEADER(config.gnu.h)
+AM_CONFIG_HEADER(config.h)
dnl Automake
AM_DISABLE_STATIC
@@ -577,12 +577,12 @@ dnl Checks for word sizes
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(unsigned char)
if test "$ac_cv_sizeof_char" -eq 1; then
- AC_DEFINE(INT8_TYPE, [char])
+ AC_SUBST(int8_type, "char")
else
AC_MSG_ERROR([compiler has no 1 byte char])
fi
if test "$ac_cv_sizeof_unsigned_char" -eq 1; then
- AC_DEFINE(UINT8_TYPE, [unsigned char])
+ AC_SUBST(uint8_type, "unsigned char")
else
AC_MSG_ERROR([compiler has no 1 byte unsigned char])
fi
@@ -590,12 +590,12 @@ fi
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(unsigned short)
if test "$ac_cv_sizeof_short" -eq 2; then
- AC_DEFINE(INT16_TYPE, [short])
+ AC_SUBST(int16_type, "short")
else
AC_MSG_ERROR([compiler has no 2 byte short])
fi
if test "$ac_cv_sizeof_unsigned_short" -eq 2; then
- AC_DEFINE(UINT16_TYPE, [unsigned short])
+ AC_SUBST(uint16_type, "unsigned short")
else
AC_MSG_ERROR([compiler has no 2 byte unsigned short])
fi
@@ -605,38 +605,38 @@ AC_CHECK_SIZEOF(unsigned int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(unsigned long)
if test "$ac_cv_sizeof_int" -eq 4; then
- AC_DEFINE(INT32_TYPE, [int])
+ AC_SUBST(int32_type, "int")
elif test "$ac_cv_sizeof_long" -eq 4; then
- AC_DEFINE(INT32_TYPE, [long])
+ AC_SUBST(int32_type, "long")
else
AC_MSG_ERROR([compiler has no 4 byte integer])
fi
if test "$ac_cv_sizeof_unsigned_int" -eq 4; then
- AC_DEFINE(UINT32_TYPE, [unsigned int])
+ AC_SUBST(uint32_type, "unsigned int")
elif test "$ac_cv_sizeof_unsigned_long" -eq 4; then
- AC_DEFINE(UINT32_TYPE, [unsigned long])
+ AC_SUBST(uint32_type, "unsigned long")
else
AC_MSG_ERROR([compiler has no 4 byte unsigned integer])
fi
if test "$ac_cv_sizeof_long" -eq 8; then
- AC_DEFINE(INT64_TYPE, [long])
+ AC_SUBST(int64_type, "long")
else
AC_CHECK_SIZEOF(long long)
if test "$ac_cv_sizeof_long_long" -eq 8; then
AC_DEFINE(HAVE_LONG_LONG)
- AC_DEFINE(INT64_TYPE, [long long])
+ AC_SUBST(int64_type, "long long")
else
AC_MSG_ERROR([compiler has no 8 byte integer])
fi
fi
if test "$ac_cv_sizeof_unsigned_long" -eq 8; then
- AC_DEFINE(UINT64_TYPE, [unsigned long])
+ AC_SUBST(uint64_type, "unsigned long")
else
AC_CHECK_SIZEOF(unsigned long long)
if test "$ac_cv_sizeof_unsigned_long_long" -eq 8; then
AC_DEFINE(HAVE_UNSIGNED_LONG_LONG)
- AC_DEFINE(UINT64_TYPE, [unsigned long long])
+ AC_SUBST(uint64_type, "unsigned long long")
else
AC_MSG_ERROR([compiler has no 8 byte unsigned integer])
fi
@@ -644,14 +644,14 @@ fi
AC_CHECK_SIZEOF(float)
if test "$ac_cv_sizeof_float" -eq 4; then
- AC_DEFINE(FLOAT4_TYPE, [float])
+ AC_SUBST(float4_type, "float")
else
AC_MSG_ERROR([compiler has no 4 byte float])
fi
AC_CHECK_SIZEOF(double)
if test "$ac_cv_sizeof_double" -eq 8; then
- AC_DEFINE(DOUBLE8_TYPE, [double])
+ AC_SUBST(double8_type, "double")
else
AC_MSG_ERROR([compiler has no 8 byte double])
fi
@@ -797,7 +797,7 @@ EOF
fi
dnl Output
-AC_OUTPUT([ Doxyfile Makefile beecrypt.spec
+AC_OUTPUT([ Doxyfile Makefile beecrypt.spec types.h
docs/Makefile gas/Makefile masm/Makefile mwerks/Makefile
tests/Makefile ],
[
diff --git a/beecrypt/debug.h b/beecrypt/debug.h
new file mode 100644
index 000000000..44c8d6471
--- /dev/null
+++ b/beecrypt/debug.h
@@ -0,0 +1,20 @@
+/**
+ * To be included after all other includes.
+ */
+#ifndef H_DEBUG
+#define H_DEBUG
+
+#include <assert.h>
+
+#ifdef __LCLINT__
+#define ntohl(_x) (_x)
+#define ntohs(_x) (_x)
+#define htonl(_x) (_x)
+#define htons(_x) (_x)
+#endif
+
+#ifdef DMALLOC
+#include <dmalloc.h>
+#endif
+
+#endif /* H_DEBUG */
diff --git a/beecrypt/dhaes.c b/beecrypt/dhaes.c
index da4bd0b11..5f89bcd76 100644
--- a/beecrypt/dhaes.c
+++ b/beecrypt/dhaes.c
@@ -48,19 +48,12 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "dhaes.h"
#include "dlsvdp-dh.h"
#include "blockmode.h"
#include "blockpad.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
+#include "debug.h"
int dhaes_pUsable(const dhaes_pParameters* params)
{
diff --git a/beecrypt/dldp.c b/beecrypt/dldp.c
index b8c6bd169..26ee75f81 100644
--- a/beecrypt/dldp.c
+++ b/beecrypt/dldp.c
@@ -27,18 +27,11 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "dldp.h"
#include "mp32.h"
#include "mp32prime.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_MALLOC
-# include <malloc.h>
-#endif
+#include "debug.h"
/**
*/
diff --git a/beecrypt/dlkp.c b/beecrypt/dlkp.c
index 3229ae048..67f86093a 100644
--- a/beecrypt/dlkp.c
+++ b/beecrypt/dlkp.c
@@ -27,9 +27,9 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "dlkp.h"
+#include "debug.h"
int dlkp_pPair(dlkp_p* kp, randomGeneratorContext* rgc, const dldp_p* param)
{
diff --git a/beecrypt/dlpk.c b/beecrypt/dlpk.c
index 78b64bdd5..6d53bdb0e 100644
--- a/beecrypt/dlpk.c
+++ b/beecrypt/dlpk.c
@@ -25,10 +25,10 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "dlpk.h"
#include "mp32.h"
+#include "debug.h"
int dlpk_pInit(dlpk_p* pk)
{
diff --git a/beecrypt/dlsvdp-dh.c b/beecrypt/dlsvdp-dh.c
index ac8b425c5..837b9943e 100644
--- a/beecrypt/dlsvdp-dh.c
+++ b/beecrypt/dlsvdp-dh.c
@@ -25,9 +25,9 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "dlsvdp-dh.h"
+#include "debug.h"
int dlsvdp_pDHSecret(const dldp_p* dp, const mp32number* x, const mp32number* y, mp32number* s)
{
diff --git a/beecrypt/docs/Makefile.in b/beecrypt/docs/Makefile.in
index 0e4449b8e..0597f5c03 100644
--- a/beecrypt/docs/Makefile.in
+++ b/beecrypt/docs/Makefile.in
@@ -108,14 +108,24 @@ ac_cv_have_java = @ac_cv_have_java@
ac_cv_have_javac = @ac_cv_have_javac@
am__include = @am__include@
am__quote = @am__quote@
+double8_type = @double8_type@
+float4_type = @float4_type@
install_sh = @install_sh@
+int16_type = @int16_type@
+int32_type = @int32_type@
+int64_type = @int64_type@
+int8_type = @int8_type@
+uint16_type = @uint16_type@
+uint32_type = @uint32_type@
+uint64_type = @uint64_type@
+uint8_type = @uint8_type@
AUTOMAKE_OPTIONS = gnu no-dependencies
EXTRA_DIST = index.html installing.html using.html developing.html api.html manual.css
subdir = docs
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.gnu.h
+CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
depcomp =
DIST_SOURCES =
diff --git a/beecrypt/dsa.c b/beecrypt/dsa.c
index 3db13fb7a..8497035cf 100644
--- a/beecrypt/dsa.c
+++ b/beecrypt/dsa.c
@@ -41,18 +41,11 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "dsa.h"
#include "dldp.h"
#include "mp32.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
+#include "debug.h"
/*@unchecked@*/
static int _debug = 0;
diff --git a/beecrypt/elgamal.c b/beecrypt/elgamal.c
index 768f59c6e..2573f1b8d 100644
--- a/beecrypt/elgamal.c
+++ b/beecrypt/elgamal.c
@@ -54,18 +54,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "elgamal.h"
#include "dldp.h"
#include "mp32.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
+#include "debug.h"
int elgv1sign(const mp32barrett* p, const mp32barrett* n, const mp32number* g, randomGeneratorContext* rgc, const mp32number* hm, const mp32number* x, mp32number* r, mp32number* s)
{
diff --git a/beecrypt/endianness.c b/beecrypt/endianness.c
index 2de4daba6..d54db9098 100644
--- a/beecrypt/endianness.c
+++ b/beecrypt/endianness.c
@@ -23,15 +23,9 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "endianness.h"
-
-#if HAVE_STRING_H
-# include <string.h>
-#endif
-
-#include <stdio.h>
+#include "debug.h"
/*@-shiftimplementation@*/
int16 swap16(int16 n)
diff --git a/beecrypt/entropy.c b/beecrypt/entropy.c
index 528d9930f..62d90f0e5 100644
--- a/beecrypt/entropy.c
+++ b/beecrypt/entropy.c
@@ -28,6 +28,7 @@
#define BEECRYPT_DLL_EXPORT
+#include "system.h"
#include "entropy.h"
#include "endianness.h"
@@ -39,13 +40,6 @@
# if HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
# endif
-# if HAVE_SYS_STAT_H
-# include <sys/types.h>
-# include <sys/stat.h>
-# endif
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# endif
# if HAVE_SYS_AUDIOIO_H
# include <sys/audioio.h>
# endif
@@ -119,23 +113,7 @@ aio_fsync (int __operation, struct aiocb *__aiocbp)
# endif
#endif
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#if HAVE_STRING_H
-# include <string.h>
-#endif
-#if HAVE_ERRNO_H
-# include <errno.h>
-#endif
-
-#include <stdio.h>
+#include "debug.h"
#if WIN32
static HINSTANCE entropy_instance = (HINSTANCE) 0;
diff --git a/beecrypt/fips180.c b/beecrypt/fips180.c
index ba02be9f8..1ded34d64 100644
--- a/beecrypt/fips180.c
+++ b/beecrypt/fips180.c
@@ -28,11 +28,11 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "fips180.h"
#include "mp32.h"
#include "endianness.h"
+#include "debug.h"
/** \ingroup HASH_sha1_m
*/
diff --git a/beecrypt/fips186.c b/beecrypt/fips186.c
index be5908232..72fae95a6 100644
--- a/beecrypt/fips186.c
+++ b/beecrypt/fips186.c
@@ -25,18 +25,11 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "fips186.h"
#include "mp32.h"
#include "mp32opt.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
+#include "debug.h"
/**
*/
diff --git a/beecrypt/gas/Makefile.in b/beecrypt/gas/Makefile.in
index f1c5f46bb..311198cdf 100644
--- a/beecrypt/gas/Makefile.in
+++ b/beecrypt/gas/Makefile.in
@@ -108,14 +108,24 @@ ac_cv_have_java = @ac_cv_have_java@
ac_cv_have_javac = @ac_cv_have_javac@
am__include = @am__include@
am__quote = @am__quote@
+double8_type = @double8_type@
+float4_type = @float4_type@
install_sh = @install_sh@
+int16_type = @int16_type@
+int32_type = @int32_type@
+int64_type = @int64_type@
+int8_type = @int8_type@
+uint16_type = @uint16_type@
+uint32_type = @uint32_type@
+uint64_type = @uint64_type@
+uint8_type = @uint8_type@
AUTOMAKE_OPTIONS = gnu no-dependencies
EXTRA_DIST = blowfishopt.i586.S fips180opt.i586.S mp32opt.arm.S mp32opt.i386.S mp32opt.ia64.S mp32opt.powerpc.S mp32opt.sparcv8.S mp32opt.sparcv9.S mp64opt.ia64.S
subdir = gas
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.gnu.h
+CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
depcomp =
DIST_SOURCES =
diff --git a/beecrypt/hmac.c b/beecrypt/hmac.c
index ae51c290d..2554a1f37 100644
--- a/beecrypt/hmac.c
+++ b/beecrypt/hmac.c
@@ -25,10 +25,10 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "hmac.h"
#include "endianness.h"
+#include "debug.h"
#define HMAC_IPAD 0x36363636
#define HMAC_OPAD 0x5c5c5c5c
diff --git a/beecrypt/hmacmd5.c b/beecrypt/hmacmd5.c
index 8c0fcf388..42754bdd1 100644
--- a/beecrypt/hmacmd5.c
+++ b/beecrypt/hmacmd5.c
@@ -25,9 +25,9 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "hmacmd5.h"
+#include "debug.h"
/*@-sizeoftype@*/
const keyedHashFunction hmacmd5 = { "HMAC-MD5", sizeof(hmacmd5Param), 64, 4 * sizeof(uint32), 64, 512, 32, (const keyedHashFunctionSetup) hmacmd5Setup, (const keyedHashFunctionReset) hmacmd5Reset, (const keyedHashFunctionUpdate) hmacmd5Update, (const keyedHashFunctionDigest) hmacmd5Digest };
diff --git a/beecrypt/hmacsha1.c b/beecrypt/hmacsha1.c
index 198dd346f..0c490707b 100644
--- a/beecrypt/hmacsha1.c
+++ b/beecrypt/hmacsha1.c
@@ -25,9 +25,9 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "hmacsha1.h"
+#include "debug.h"
/*@-sizeoftype@*/
const keyedHashFunction hmacsha1 = { "HMAC-SHA-1", sizeof(hmacsha1Param), 64, 5 * sizeof(uint32), 64, 512, 32, (keyedHashFunctionSetup) hmacsha1Setup, (keyedHashFunctionReset) hmacsha1Reset, (keyedHashFunctionUpdate) hmacsha1Update, (keyedHashFunctionDigest) hmacsha1Digest };
diff --git a/beecrypt/hmacsha256.c b/beecrypt/hmacsha256.c
index 900368923..317b2cc00 100644
--- a/beecrypt/hmacsha256.c
+++ b/beecrypt/hmacsha256.c
@@ -25,9 +25,9 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "hmacsha256.h"
+#include "debug.h"
/*@-sizeoftype@*/
const keyedHashFunction hmacsha256 = { "HMAC-SHA-256", sizeof(hmacsha256Param), 64, 8 * sizeof(uint32), 64, 512, 32, (keyedHashFunctionSetup) hmacsha256Setup, (keyedHashFunctionReset) hmacsha256Reset, (keyedHashFunctionUpdate) hmacsha256Update, (keyedHashFunctionDigest) hmacsha256Digest };
diff --git a/beecrypt/javaglue.c b/beecrypt/javaglue.c
index 251abfc9b..2f1465f78 100644
--- a/beecrypt/javaglue.c
+++ b/beecrypt/javaglue.c
@@ -7,6 +7,7 @@
#define JNIEXPORT /*@unused@*/
#define JNICALL
+#include "system.h"
#include "beecrypt.h"
#include "blockmode.h"
@@ -15,14 +16,8 @@
#if JAVAGLUE
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
-
#include "javaglue.h"
+#include "debug.h"
/* For now, I'm lazy ... */
/*@-nullpass -nullret -shiftsigned -usedef -temptrans -freshtrans @*/
diff --git a/beecrypt/masm/Makefile.in b/beecrypt/masm/Makefile.in
index 9837efd6c..5c485006b 100644
--- a/beecrypt/masm/Makefile.in
+++ b/beecrypt/masm/Makefile.in
@@ -108,14 +108,24 @@ ac_cv_have_java = @ac_cv_have_java@
ac_cv_have_javac = @ac_cv_have_javac@
am__include = @am__include@
am__quote = @am__quote@
+double8_type = @double8_type@
+float4_type = @float4_type@
install_sh = @install_sh@
+int16_type = @int16_type@
+int32_type = @int32_type@
+int64_type = @int64_type@
+int8_type = @int8_type@
+uint16_type = @uint16_type@
+uint32_type = @uint32_type@
+uint64_type = @uint64_type@
+uint8_type = @uint8_type@
AUTOMAKE_OPTIONS = gnu no-dependencies
EXTRA_DIST = blowfishopt.i586.asm fips180opt.i586.asm mp32opt.i386.asm
subdir = masm
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.gnu.h
+CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
depcomp =
DIST_SOURCES =
diff --git a/beecrypt/md5.c b/beecrypt/md5.c
index 1c6e3b9e7..34e91d1e6 100644
--- a/beecrypt/md5.c
+++ b/beecrypt/md5.c
@@ -25,11 +25,11 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "md5.h"
#include "mp32.h"
#include "endianness.h"
+#include "debug.h"
/** \ingroup HASH_md5_m
*/
diff --git a/beecrypt/memchunk.c b/beecrypt/memchunk.c
index 40597be9b..59fa2ee6f 100644
--- a/beecrypt/memchunk.c
+++ b/beecrypt/memchunk.c
@@ -23,16 +23,9 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "memchunk.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
+#include "debug.h"
/*@-compdef@*/ /* tmp->data is undefined */
memchunk* memchunkAlloc(int size)
diff --git a/beecrypt/memchunk.h b/beecrypt/memchunk.h
index 559a061c8..64d8e0ee4 100644
--- a/beecrypt/memchunk.h
+++ b/beecrypt/memchunk.h
@@ -25,9 +25,7 @@
#ifndef _MEMCHUNK_H
#define _MEMCHUNK_H
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "types.h"
typedef struct
{
diff --git a/beecrypt/mp32.c b/beecrypt/mp32.c
index 8b218cc65..190d31bbe 100644
--- a/beecrypt/mp32.c
+++ b/beecrypt/mp32.c
@@ -25,11 +25,9 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "mp32.h"
-
-#include <stdio.h>
+#include "debug.h"
#ifndef ASM_MP32ZERO
void mp32zero(register uint32 xsize, register uint32* xdata)
diff --git a/beecrypt/mp32barrett.c b/beecrypt/mp32barrett.c
index 25d211fda..bada4a887 100644
--- a/beecrypt/mp32barrett.c
+++ b/beecrypt/mp32barrett.c
@@ -31,20 +31,11 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "mp32.h"
#include "mp32prime.h"
#include "mp32barrett.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
-
-#include <stdio.h>
+#include "debug.h"
/**
* mp32bzero
diff --git a/beecrypt/mp32number.c b/beecrypt/mp32number.c
index 342887228..b7c9c11ff 100644
--- a/beecrypt/mp32number.c
+++ b/beecrypt/mp32number.c
@@ -27,17 +27,10 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "mp32number.h"
#include "mp32.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
+#include "debug.h"
/*@-nullstate@*/ /* n->data may be NULL */
void mp32nzero(mp32number* n)
diff --git a/beecrypt/mp32number.h b/beecrypt/mp32number.h
index 9ad04b5a4..a5700411c 100644
--- a/beecrypt/mp32number.h
+++ b/beecrypt/mp32number.h
@@ -28,9 +28,7 @@
#ifndef _MP32NUMBER_H
#define _MP32NUMBER_H
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "types.h"
/**
*/
diff --git a/beecrypt/mp32prime.c b/beecrypt/mp32prime.c
index 2c83d3697..c7955e748 100644
--- a/beecrypt/mp32prime.c
+++ b/beecrypt/mp32prime.c
@@ -25,20 +25,11 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "mp32prime.h"
#include "mp32.h"
#include "mp32barrett.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
-
-#include <stdio.h>
+#include "debug.h"
/**
* A word of explanation here on what these tables accomplish:
diff --git a/beecrypt/mtprng.c b/beecrypt/mtprng.c
index acbbff113..6e4db6638 100644
--- a/beecrypt/mtprng.c
+++ b/beecrypt/mtprng.c
@@ -35,18 +35,11 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "mtprng.h"
#include "mp32.h"
#include "mp32opt.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
+#include "debug.h"
#define hiBit(a) ((a) & 0x80000000)
#define loBit(a) ((a) & 0x1)
diff --git a/beecrypt/mwerks/Makefile.in b/beecrypt/mwerks/Makefile.in
index b17d9b5ac..75a3ccdcc 100644
--- a/beecrypt/mwerks/Makefile.in
+++ b/beecrypt/mwerks/Makefile.in
@@ -108,14 +108,24 @@ ac_cv_have_java = @ac_cv_have_java@
ac_cv_have_javac = @ac_cv_have_javac@
am__include = @am__include@
am__quote = @am__quote@
+double8_type = @double8_type@
+float4_type = @float4_type@
install_sh = @install_sh@
+int16_type = @int16_type@
+int32_type = @int32_type@
+int64_type = @int64_type@
+int8_type = @int8_type@
+uint16_type = @uint16_type@
+uint32_type = @uint32_type@
+uint64_type = @uint64_type@
+uint8_type = @uint8_type@
AUTOMAKE_OPTIONS = gnu no-dependencies
EXTRA_DIST = beecrypt.pch blowfishopt.i586.asm fips180opt.i586.asm mp32opt.i386.asm
subdir = mwerks
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.gnu.h
+CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
depcomp =
DIST_SOURCES =
diff --git a/beecrypt/rsa.c b/beecrypt/rsa.c
index 78c0068b1..6628c6d3e 100644
--- a/beecrypt/rsa.c
+++ b/beecrypt/rsa.c
@@ -25,17 +25,10 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "rsa.h"
#include "mp32.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
+#include "debug.h"
int rsapri(const rsakp* kp, const mp32number* m, mp32number* c)
{
diff --git a/beecrypt/rsakp.c b/beecrypt/rsakp.c
index 159ce0716..10d0a7457 100644
--- a/beecrypt/rsakp.c
+++ b/beecrypt/rsakp.c
@@ -27,21 +27,11 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "rsakp.h"
#include "mp32prime.h"
#include "mp32.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
-#if HAVE_STRING_H
-# include <string.h>
-#endif
+#include "debug.h"
int rsakpMake(rsakp* kp, randomGeneratorContext* rgc, int nsize)
{
diff --git a/beecrypt/rsapk.c b/beecrypt/rsapk.c
index 5032941be..50a2091a7 100644
--- a/beecrypt/rsapk.c
+++ b/beecrypt/rsapk.c
@@ -27,13 +27,9 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "rsapk.h"
-
-#if HAVE_STRING_H
-# include <string.h>
-#endif
+#include "debug.h"
int rsapkInit(rsapk* pk)
{
diff --git a/beecrypt/sha256.c b/beecrypt/sha256.c
index 437fb7018..cd3db258e 100644
--- a/beecrypt/sha256.c
+++ b/beecrypt/sha256.c
@@ -25,11 +25,11 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "sha256.h"
#include "mp32.h"
#include "endianness.h"
+#include "debug.h"
/**
*/
diff --git a/beecrypt/system.h b/beecrypt/system.h
new file mode 100644
index 000000000..58426c180
--- /dev/null
+++ b/beecrypt/system.h
@@ -0,0 +1,72 @@
+/**
+ * \file beecrypt/system.h
+ */
+
+#ifndef H_SYSTEM
+#define H_SYSTEM
+
+#define BEECRYPT_DLL_EXPORT
+
+#if defined(_WIN32) && !defined(WIN32)
+# define WIN32 1
+#endif
+
+#if WIN32 && !__CYGWIN32__
+# include "config.win.h"
+#else
+# ifdef HAVE_CONFIG_H
+# include "config.h"
+# endif
+#endif
+
+#include "types.h"
+
+#if HAVE_SYS_STAT_H
+# include <sys/types.h>
+# include <sys/stat.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+
+#if HAVE_ERRNO_H
+# include <errno.h>
+#endif
+
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#else
+# include <sys/file.h>
+#endif
+
+#if HAVE_CTYPE_H
+# include <ctype.h>
+#endif
+
+#if HAVE_MALLOC_H
+# include <malloc.h>
+#endif
+
+#endif /* H_SYSTEM */
diff --git a/beecrypt/tests/Makefile.in b/beecrypt/tests/Makefile.in
index 7b780aa9c..66bbd17cc 100644
--- a/beecrypt/tests/Makefile.in
+++ b/beecrypt/tests/Makefile.in
@@ -108,7 +108,17 @@ ac_cv_have_java = @ac_cv_have_java@
ac_cv_have_javac = @ac_cv_have_javac@
am__include = @am__include@
am__quote = @am__quote@
+double8_type = @double8_type@
+float4_type = @float4_type@
install_sh = @install_sh@
+int16_type = @int16_type@
+int32_type = @int32_type@
+int64_type = @int64_type@
+int8_type = @int8_type@
+uint16_type = @uint16_type@
+uint32_type = @uint32_type@
+uint64_type = @uint64_type@
+uint8_type = @uint8_type@
AUTOMAKE_OPTIONS = gnu no-dependencies
@@ -123,7 +133,7 @@ beetest_LDFLAGS = -all-static
openpgp_SOURCES = openpgp.c
subdir = tests
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.gnu.h
+CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
EXTRA_PROGRAMS = beetest$(EXEEXT) openpgp$(EXEEXT)
am_beetest_OBJECTS = beetest.$(OBJEXT)
diff --git a/beecrypt/timestamp.c b/beecrypt/timestamp.c
index d4eead2a3..54f5d927d 100644
--- a/beecrypt/timestamp.c
+++ b/beecrypt/timestamp.c
@@ -23,16 +23,9 @@
*
*/
-#define BEECRYPT_DLL_EXPORT
-
+#include "system.h"
#include "timestamp.h"
-
-#if HAVE_TIME_H
-# include <time.h>
-#endif
-#if HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
+#include "debug.h"
javalong timestamp()
{
diff --git a/beecrypt/types.h.in b/beecrypt/types.h.in
new file mode 100644
index 000000000..f4870a177
--- /dev/null
+++ b/beecrypt/types.h.in
@@ -0,0 +1,71 @@
+/*
+ * types.h
+ *
+ * Types.h generic system types file
+ *
+ * Copyright (c) 2000 Virtual Unlimited B.V.
+ *
+ * Author: Bob Deblier <bob@virtualunlimited.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef _TYPES_H
+#define _TYPES_H
+
+#ifndef ROTL32
+# define ROTL32(x, s) (((x) << (s)) | ((x) >> (32 - (s))))
+#endif
+#ifndef ROTR32
+# define ROTR32(x, s) (((x) >> (s)) | ((x) << (32 - (s))))
+#endif
+
+#if WIN32 && !__CYGWIN32__
+# ifdef BEECRYPT_DLL_EXPORT
+# define BEECRYPTAPI __declspec(dllexport)
+# else
+# define BEECRYPTAPI __declspec(dllimport)
+# endif
+#else
+# define BEECRYPTAPI
+typedef @uint8_type@ byte;
+#endif
+
+/*@-typeuse@*/
+typedef @int8_type@ int8;
+/*@=typeuse@*/
+typedef @int16_type@ int16;
+typedef @int32_type@ int32;
+typedef @int64_type@ int64;
+
+typedef @uint8_type@ uint8;
+typedef @uint16_type@ uint16;
+typedef @uint32_type@ uint32;
+/*@-duplicatequals@*/
+typedef @uint64_type@ uint64;
+/*@=duplicatequals@*/
+
+typedef @int8_type@ javabyte;
+typedef @int16_type@ javashort;
+typedef @int32_type@ javaint;
+typedef @int64_type@ javalong;
+
+typedef @uint16_type@ javachar;
+
+typedef @float4_type@ javafloat;
+typedef @double8_type@ javadouble;
+
+#endif